Next / Previous / Contents / Shipman's homepage

9.5. Definition lists: variablelist

Another commonly used special paragraph shape is to display a list of terms to be defined, each followed by an indented paragraph containing the description.

For this shape:

Here is an example of a list containing two terms:

      <variablelist>
        <varlistentry>
          <term>
            <code >.__abs__(self)</code >
          </term>
          <listitem>
            <para>
              Defines the behavior of the <code >abs()</code > function
              when applied to an object of your class.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <code >.__add__(self,<replaceable >other</replaceable
            >)</code >
          </term>
          <listitem>
            <para>
              Defines the behavior of this class for <code
              >self+<replaceable>other</replaceable ></code >.
            </para>
          </listitem>
        </varlistentry>
      </variablelist>

And here is how that looks when formatted:

.__abs__(self)

Defines the behavior of the abs() function when applied to an object of your class.

.__add__(self,other)

Defines the behavior of this class for self+other.