|
Amaya allows you to include mathematical expressions in web pages, following the Mathematical Markup Language (MathML) specification. Mathematical expressions are handled as structured components, exactly in the same way as HTML elements. Therefore, you can manipulate math expressions in the same way you manipulate other parts of HTML documents. All editing commands provided by Amaya for handling text are also available for math, and there are some additional controls to enter mathematical constructs.
Warning: In the current version of Amaya only a subset of MathML is implemented. The purpose of this alpha version of the math extension is to show how MathML may improve scientific communication over the Web. A more complete and more robust implementation is planed for future releases.
To create a mathematical expression in a document, just move the insertion point (the caret) to the position where you want to insert that expression, and click the Math button (the rightmost button), or select the last entry (Math) from the Types menu. The Math button displays a palette that stays on the screen until you click the Done button. Item Math from the Types menu displays a popup menu. Just choose the most convenient tool. Both allow you to select the mathematical construct to be inserted.
In the Math palette (or menu) the first two items allow you to create a new formula when the caret is in some HTML element (but the caret should not be within a MathML element):
The next items of the Math menu (or palette) allow you to
create new constructs within a formula. If the caret is not in a formula, a
Math
element is created first to accept the new construct. In
this version of Amaya, the available constructs are, from top to bottom:
mroot
in MathML:
msqrt
:
mfrac
:
msubsup
:
or
msub
:
msup
:
munderover
:
munder
:
mover
:
mrow
:
mmultiscripts
:
mtable
:
The last item of the Math palette ( ) displays another palette from which you can insert mathematical symbols and greek characters.
You are not obliged to use a menu or a palette to create and edit mathematical expressions. You can enter mathematical constructs directly from the keyboard, as each item in the Math menu has a keyboard equivalent (all shortcuts are listed in the menu). This allows you to type faster. To type even faster, you may also use the keyboard to move the caret from a construct to another, with the arrow keys.
When you type a character string in a MathML element, Amaya parses that string
and generates elements mo
(operator), mn
(number),
mi
(identifier), mtext
automatically. For instance,
to enter
just type x=2a+b
, (don't forget to first click on the Math or
MathDisp item of the Math menu, if you are not in a
mathematical expression) and you will get the following structure (you can
check in the Math_Structure view):
<mi>x</mi><mo>=</mo><mn>2</mn><mi>a</mi><mo>+</mo><mi>b</mi>
You may want to change the structure of an existing expression, e.g. appending a superscript or puting parentheses around an expression. Select the expression and enter the new construct with the palette, the Math menu or the keyboard.
You can also use the Transform command from the Special menu. Select the expression you want to transform and the Transform command will display a menu with all possible changes.
Whenever a document contains some MathML elements, choosing the Show Structure item from the Views menu actually opens two views:
MATH
tag and
their actual contents is not shown.
You can edit math expressions either in the main view or in the Math_Structure view. The Math_Structure view is especially helpful to avoid ambiguity. Consider the following example:
When moving the caret after character b, it is not clear whether you want to add something within the square root or after it. Selecting (or checking) in the Math_Structure view avoids any ambiguity.
You can create and use links in mathematical expressions. These links are represented in the XML Linking Language (XLink). Only the simple unidirectional hyperlinks are available, but you can associate a link with any part of a formula. For example, the fraction in the formula below is a link to the W3C home page:
Double-click any character within the fraction will get the W3C home page. In the XML file, the fraction is represented by:
<mfrac xml:link="simple" href="http://www.w3.org/">...</mfrac>
To create such a link, just select an expression (the fraction in the above
example), click on the Link button (or select "createLink" from the Links
menu) and click on the desired target. If the target is an expression in a
formula, you first have to turn that expression into a target. Just select the
expression and select "create Target" from the Links menu. This creates an
id
attribute for the target expression.
Amaya implements only the Presentation Tags from MathML, not the
Content Markup. All presentation elements are available, but only
some MathML attributes are currently implemented (for instance
fontstyle
which is available in the Attributes
menu when a mi
element is selected). However, the
class
, id
and style
attributes are
available, with the same semantics as in HTML: you can associate CSS style with MathML elements
(class
and style
attributes) and a MathML element
can be the target of a link (id
attribute).