OQMath has been intended to write OMDoc
document sources as most readable as possible. So we present mostly examples for this language.
It could, however, certainly be used to write the semantic elements of
MathML expressions or
the OMOBJ elements of
MathBook pages.
It is to be noted that the preferred encoding throughout here is the UTF-8 encoding allowing all of the Unicode 3.0 character range to be used. This allows, for example, for all the mathematical symbols, arrows, and greek-letters to be used. (see the Unicode Code Charts)
It is thus recommended to use an editor that supports UTF-8 and appropriate fonts to display this character-ranges. The jEdit editor does so very well. (please see also the jEdit-OQMath distribution). Emacs version 21 and up does it. In doubt, using the YUdit editor may be very useful. Several of these editors support an advanced input-method that allows the mathematical characters to be typed by typing a sequence of characters. This comes handy but copy and paste should work in most cases as well.
We detail a part of the example which can be obtained using
the command java -jar OQMath.jar --example.
This file can be viewed or downloaded.
Consider the following definition of the hyperbolic n-space:
<definition id="def_Hn" for="Hn">
<metadata><Title>Definition of Hn</Title></metadata>
<CMP xml:lang="en">
The set of points of $Rn$ whose last component is positive is called
the half-space:
$Hn = set(x | x ∈ Rn ∧ π(n,x) > 0)$
</CMP>
</definition>
For this, however, we would need a bit more OMDoc content which should declare the
Hn, Rn, and π symbols.
Here they are:
<symbol id="Hn"><commonname>Hyperbolic n-space</commonname></symbol>
<symbol id="Rn"><commonname>Euclidean n-space</commonname></symbol>
<symbol id="projection"><commonname>n-th projection of the euclidean space</commonname></symbol>
Now we need indicate to QMath that we would like to use these symbols within our formulae, for this, we provide the following processing-instructions which are passed to QMath verbatim:
<?QMath Symbol: Rn SYMBOL "topDiff_intro:Rn" ?>
<?QMath Symbol: π APPLICATION "topDiff_intro:projection" ?>
<?QMath Symbol: Hn SYMBOL "topDiff_intro:Hn" ?>
Symbol: prefix declares to QMath that what follows is a symbol declaration,
then comes (outside white-spaces) the sequence of characters for this symbol, then comes the symbol-type
which can be any of SYMBOL (no parameter), APPLICATION
(any number of parameters in brackets), OP_OR, OP_AND,
OP_PLUS, OP_TIMES, OP_EXP, OP_FACT
(for binary operators in increasing precendence order).
See the overview of QMath symbols.
QMath is actually completely configurable and is built using these Symbol: declarations from the ground up
and has a set of predefined context files describing a classical use of
mathematical symbol characters for each language and for each of the OpenMath content-dictionaries symbols.
Please see, the contexts directory of the QMath directory for the complete list.
For our example, here is what we would put at the header of the file:
<?QMath Context:"Mathematics/Arithmetic" ?>
<?QMath Context:"Mathematics/Logic" ?>
<?QMath Context:"Mathematics/Set_theory"?>
<?QMath Context:"Mathematics/OMDoc"?>
<?QMath Context:"Mathematics/OpenMath/set1"?>