Task ma-3: creating a symbol and writing a presentation-notation
This task describes the introduction of an angle symbol along with its input (QMath) notation as well as its presentation.
Prerequisite:
Task steps
- let us first declare the symbol that interests us
- use jEditOQMath, open first.oqmath and put your cursor right before
</theory>
- open, on the left, the tab Templates tree then click the Symbol template
- we now fill the gaps (aka the template zones) for the symbol, give it the id
angle
- invoke Go to next template zone (CS-g), fill in the child-text of the
CMP element which is the description of the symbol, e.g. This symbol has three arguments and returns the angle between the three points, centered at the middle point
- invoke Go to next template zone, fill in the child-text of the
commonname element, this will be the title and tooltip of this symbol, e.g. angle between three points
- now first edit the notations.qmath file by adding the following line at the end then save notations. This will add a QMath notation for our symbol.
Symbol: angle APPLICATION 'my_first_theory:angle'
now we complement the presentation of this symbol, back into first.oqmath right after the </symbol> element
- invoke CS-g again, enter the id of the symbolpresentation element, for example
angle_pres
- CS-g again, the
for attribute is the target of our notations, the symbol id, i.e. angle, this will show as the underlying semantic of our presented symbol (e.g. as giving the text of the tooltip)
- under the
notation element, put two children, an OpenMath expression (or a QMath) and a MathML-p expression
- the first template-zone is the QMath expression that is a typical notation. In our case, it would be
$angle(A,B,C)$
- the second template-zone is the MathML-expression for it. In this case, we need to enter simply a row of elements with the angle character as first, in MathML this is said as:
<math><mrow><mo>∠</mo><mi>A</mi><mi>B</mi><mi>C</mi></mrow></math> (note the character between <mo> and </mo, it is the angle unicode character ∠ of number hex 2220.
- now let us try to use this, copy and paste the following example using it after the
</symbolpresentation> tag:
<example id="angle_exp" for="angle">
<metadata><Title>Angle example</Title></metadata>
<CMP>
An example of angle is $angle(A,B,C)$.
</CMP>
</example>
save your file (press the pen or invoke C-S)
- click the AntFarm tab on the left
- select collection, ActiveMath Publishing build file
- press the running man
- wait till it says `BUILD SUCCESSFUL
- go to your browser
- open the book Complete Recbook
- see the symbol element within the book as well as the example
Trackback URL for this post:http://eds.activemath.org/en/trackback/140
|