Close this window

Using the <figure> tag

Description The figure tag is used to provide the structure for inserting a figure into a CNXML document. A figure may contain an image, multimedia object, a table, a block of code, or mutiple such items.
Example
This CNXML:
<figure id="fig1">
  <name>Figure Name Here</name>
  <media type="image/jpeg" src="image1.jpg"/>
  <caption>A figure's caption would go here.  It 
    could offer a more detailed explanation of the 
    figure than offered in the name.</caption>
</figure>
	
Results in this display:
Figure Name Here
Figure 1: A figure's caption would go here. It could offer a more detailed explanation of the figure than offered in the name.
Example
This CNXML:
<figure id="fig2">
  <name>A block of code as a figure</name>
  <code type="block">
    &lt;html&gt;
      &lt;head&gt;
	&lt;title&gt;Basic HTML tags&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
	Content goes here
      &lt;/body&gt;
    &lt;/html&gt;
  </code>
</figure>
	
Results in this display:
A block of code as a figure
<html>
  <head>
    <title>Basic HTML tags</title>
  </head>
  <body>
    Content goes here
  </body>
</html>
		  
Figure 2
Attributes (what's this?)
Children (what's this?) First, figure may contain an optional name tag. Next, it must contain either two or more subfigure tags, or a single media, table, or code tag. Finally, figure may contain an optional caption tag.
Parents (what's this?)para, content, section, example, meaning, proof, statement, problem, solution
Close this window