Close this window

# Using the <rule> tag

## Description

The `rule` tag defines any type of "rule," such as a theorem, axiom, lemma, rule of thumb, etc., that is presented as a statement optionally accompanied by a proof or examples. This tag is especially useful for mathematical texts.

## Example

This CNXML:

``````
<rule type='theorem' id='pythag-rule'>
<title>Pythagorean Theorem</title>
<statement id='pythag-statement'>
<para id='pythag-para1'>
On a right triangle, the sum of the squares of
the sides equals the square of the hypotenuse.
</para>
</statement>
<proof id='pythag-proof'>
<para id='pythag-para2'>
Your favorite proof goes here.
</para>
</proof>
<example id="pythag-example">
<para id='pythag-para3'>
Take a right triangle whose sides are of length
3, 4, and 5. In this case the sum of the square
of the two shorter sides is 9+16=25. The square
of the hypotenuse is 25. So the theorem holds.
</para>
</example>
</rule>
``````

Results in this display:

## Theorem 1: Pythagorean Theorem

On a right triangle, the sum of the squares of the sides equals the square of the hypotenuse.

### Proof

Your favorite proof goes here.

### Example

Take a right triangle whose sides are of length 3, 4, and 5. In this case the sum of the square of the two shorter sides is 9+16=25. The square of the hypotenuse is 25. So the theorem holds.

## Attributes(what's this?)

• type (optional): Defines the type of rule in order to give specialized control over numbering. Rules of the same type are numbered in series (i.e., Rule 1, Rule 2...). Type can be any user-defined value, but specially supported values ("rule", "theorem", "lemma", "corollary", "law", and "proposition") will auto-generate a label corresponding to that type.
• id (required): A unique identifier, whose value must begin with a letter and contain only letters, numbers, hyphens, underscores, colons, and/or periods (no spaces).

## Children(what's this?)

First, `rule` may contain an optional label tag. Next, it may contain an optional title tag. Next, it must contain one or more statement tags. Finally, `rule` may contain zero or more proof tags and zero or more example tags in any order.

## Parents(what's this?)

Close this window