<< 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

if three forces F1.f2 .f3 act at a point on a Cartesian plane in the daigram .....so if the question says write down the x and y components ..... I really don't understand
Syamthanda Reply
hey , can you please explain oxidation reaction & redox ?
Boitumelo Reply
hey , can you please explain oxidation reaction and redox ?
Boitumelo
for grade 12 or grade 11?
Sibulele
the value of V1 and V2
Tumelo Reply
advantages of electrons in a circuit
Rethabile Reply
we're do you find electromagnetism past papers
Ntombifuthi
what a normal force
Tholulwazi Reply
it is the force or component of the force that the surface exert on an object incontact with it and which acts perpendicular to the surface
Sihle
what is physics?
Petrus Reply
what is the half reaction of Potassium and chlorine
Anna Reply
how to calculate coefficient of static friction
Lisa Reply
how to calculate static friction
Lisa
How to calculate a current
Tumelo
how to calculate the magnitude of horizontal component of the applied force
Mogano
How to calculate force
Monambi
a structure of a thermocouple used to measure inner temperature
Anna Reply
a fixed gas of a mass is held at standard pressure temperature of 15 degrees Celsius .Calculate the temperature of the gas in Celsius if the pressure is changed to 2×10 to the power 4
Amahle Reply
How is energy being used in bonding?
Raymond Reply
what is acceleration
Syamthanda Reply
a rate of change in velocity of an object whith respect to time
Khuthadzo
how can we find the moment of torque of a circular object
Kidist
Acceleration is a rate of change in velocity.
Justice
t =r×f
Khuthadzo
how to calculate tension by substitution
Precious Reply
hi
Shongi
hi
Leago
use fnet method. how many obects are being calculated ?
Khuthadzo
khuthadzo hii
Hulisani
how to calculate acceleration and tension force
Lungile Reply
you use Fnet equals ma , newtoms second law formula
Masego
please help me with vectors in two dimensions
Mulaudzi Reply
how to calculate normal force
Mulaudzi
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, Connexions tutorial and reference (中文指導及參考 - chinese). OpenStax CNX. Mar 09, 2006 Download for free at http://cnx.org/content/col10340/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Connexions tutorial and reference (中文指導及參考 - chinese)' conversation and receive update notifications?

Ask