<< Chapter < Page Chapter >> Page >
This is the second installment of the CNXML language tutorials. It is designed to give a more comprehensive look at the CNXML tags and explain some more advanced uses of the language. Includes helpful examples of CNXML tags, extending the module created in The Basic CNXML tutorial.

Example

As is often the case in textbooks, authors will include examples in the middle of a chapter or section. For thisreason CNXML provides a tag that allows an author to include examples in a document. The example tag has a unique id attribute and can contain most tags as children, the first being an optional title . For specifics you should always consult the CNXML Spec .

<example id='tboneexam'><figure id='tbonefig'><title>T-Bone Steak</title><media id="image-example" display="block" alt="A T-bone Steak."><image type='image/jpg' src='tbone.jpg'/></media></figure></example>

Figure

The figure tag provides the structure for creating a figure within a document. They can contain eithertwo or more subfigure tags, or a single media , table , or code tag.

The figure tag has two attributes:

  • id - a unique ID, required
  • orient - defines how multiple subfigure s are to be displayed. It takes two values, vertical or horizontal , and will default to horizontal .

The optional first tag of the figure tag is title which is used to title a figure.

The title tag is followed by any of the tags listed above; however, the most commonly used tag is media,which is used to include any sort of media such as images, video, music, or java applets. The media object tags have two requiredattributes:

  • src - the location of the displayed media
  • mime-type - defines the type of media being displayed, which can be any valid MIME type.
    • audio - audio/mp3, audio/wav, etc.
    • video - video/qt, video/mov, etc.
    • image - image/png, image/gif, etc.
    • application - application/PostScript, application/x-java-applet, etc.

The final tag is the optional caption which is used to add a small caption to the figure.

<figure id='tbone'><title>T-Bone Steak</title><media id="image-example" display="block" alt="A T-bone Steak."><image mime-type='image/jpeg' src='tbone.jpg'/></media><caption>Upon successful completion of these documents, you should be able to grill a steak that looks just as good!</caption></figure>

Subfigure

The subfigure tag is used when you want to include more than one media , code or table within the same figure .

The usage of the subfigure tag is similar to that of figure . It has an optional id attribute, an optional first child title tag, a single media , code or table , followed by an optional caption .

Now the orient attribute for figure becomes very important. orient lets you specify whether the subfigures should be displayed side-to-side or one on top of the other.

<figure orient='horizontal' id='horfig'><title>Steaks</title><subfigure id='subfigtbone1'><title>T-Bone</title><media id="image-example" display="block" alt="A T-bone Steak."><image type='image/jpeg' src='tbone.jpg'/></media></subfigure><subfigure id='subfingnystrip1'><title>New York Strip</title><media id="image-example" display="block" alt="A NY Strip."><image mime-type='image/jpeg' src='ny_strip.gif'/></media></subfigure><caption>Upon successful completion of these documents, you should be able to grill a steak that looks just as good!</caption></figure> Or <figure orient='vertical' id='verfig'><title>Steaks</title><subfigure id='subfigtbone2'><title>T-Bone</title><media id="image-example" display="block" alt="A T-bone Steak."><image mime-type='image/jpeg' src='tbone.jpg'/></media></subfigure><subfigure id='subfig2'><title>New York Strip</title><media id="image-example" display="block" alt="A NY Strip."><image mime-type='image/jpeg' src='ny_strip.jpg'/></media></subfigure><caption>Upon successful completion of these documents, you should be able to grill a steak that looks just as good!</caption></figure>

Questions & Answers

what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Cnxml tutorial. OpenStax CNX. Jul 08, 2009 Download for free at http://cnx.org/content/col10121/1.10
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Cnxml tutorial' conversation and receive update notifications?

Ask