home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="iso-8859-1"?>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Editing Mathematics</title>
- <meta name="GENERATOR" content="amaya V4.2.2" />
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- </head>
-
- <body xml:lang="en" lang="en">
-
- <table border="0" width="100%" summary="toc">
- <tbody>
- <tr>
- <td><img border="0" alt="W3C" src="../../Icons/WWW/w3c_home" /> <img
- border="0" alt="Amaya" src="../Icons/amaya.gif" /></td>
- <td><p align="right"><a href="Tables.html" accesskey="p"><img
- alt="previous" border="0" src="../Icons/left.gif" /></a> <a
- href="Manual.html" accesskey="t"><img alt="top" border="0"
- src="../Icons/up.gif" /></a> <a href="SVG.html" accesskey="n"><img
- alt="next" border="0" src="../Icons/right.gif" /></a></p>
- </td>
- </tr>
- <tr>
- </tr>
- </tbody>
- </table>
-
- <div id="Math">
- <h2>Editing mathematics</h2>
-
- <p>Amaya allows you to include mathematical expressions in web pages,
- following the <a href="http://www.w3.org/TR/REC-MathML/">Mathematical Markup
- Language</a> (MathML) specification. Mathematical expressions are handled as
- structured components, 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 for entering
- mathematical constructs.</p>
-
- <h3><a name="Creating">Creating a mathematical expression</a></h3>
-
- <h4>The Math palette and the Types/Math menu</h4>
-
- <p>To create a mathematical expression in a document, just <a
- href="Selecting.html#Selecting">move the insertion point</a> (the caret) to
- the position where you want to insert an expression, and then click
- the<strong>Math</strong> button <img src="../Icons/Math.gif" alt="Math" />, or
- select the <strong>Math</strong> entry from the <strong>Types</strong> menu.
- The <strong>Math</strong> button displays a palette that stays on the screen
- until you click its Done button. The item <strong>Math</strong> from
- the<strong>Types</strong> menu displays a popup menu. Just choose the most
- convenient tool for you. Both allow you to select the mathematical construct
- to be inserted.</p>
-
- <p>In the Math palette (or menu) the first item allows you to create a new
- formula when the caret is in some HTML or <a href="SVG.html">SVG</a> element
- (but the caret should not be within a MathML element).</p>
-
- <p>In the <strong>Math</strong> menu, the next items allow you to create new
- basic elements (not available in the palette): Plain text
- (<code>mtext</code>), Identifier (<code>mi</code>), Number (<code>mn</code>),
- Operator (<code>mo</code>). You can also use these commands to change the type
- of a single element or a sequence of elements.</p>
-
- <p>These items in the <strong>Math</strong> menu are followed by the Character
- (<code>&xxx;</code>) item. This command allows you to enter a character
- that is not available on the keyboard. It displays a dialogue box where you
- have to enter the character name (for instance <em>alpha</em> for the greek
- character α).</p>
-
- <p>The next items of the <strong>Math</strong> menu (or palette) allow you to
- create new constructs within a formula. If the caret is not in a formula,
- a<code>Math</code> element is created first to accept the new construct. The
- available constructs are:</p>
- <ul>
- <li>Root with index, <code>mroot</code> in MathML:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mroot>
- <mrow>
- <mi>x</mi>
- <mo>+</mo>
- <mn>1</mn>
- </mrow>
- <mn>3</mn>
- </mroot>
- </math>
- </li>
- <li>Square root, <code>msqrt</code>:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <msqrt>
- <mrow>
- <mi>x</mi>
- <mo>+</mo>
- <mn>1</mn>
- </mrow>
- </msqrt>
- </math>
- </li>
- <li>Enclose, <code>menclose</code>:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <menclose>
- <mn>1234</mn>
- </menclose>
- </math>
- </li>
- <li>Fraction, <code>mfrac</code>:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mfrac>
- <mn>1</mn>
- <mrow>
- <mi>x</mi>
- <mo>+</mo>
- <mn>1</mn>
- </mrow>
- </mfrac>
- </math>
- </li>
- <li>Expression with subscript and superscript, <code>msubsup</code>:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <msubsup>
- <mi>x</mi>
- <mrow>
- <mi>i</mi>
- <mo>+</mo>
- <mn>1</mn>
- </mrow>
- <mi>n</mi>
- </msubsup>
- </math>
- or
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <msubsup>
- <mo>∫</mo>
- <mn>0</mn>
- <mo>∞</mo>
- </msubsup>
- <mi></mi>
- </mrow>
- </math>
- </li>
- <li>Expression with a subscript, <code>msub</code>:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <msub>
- <mi>x</mi>
- <mi>i</mi>
- </msub>
- </math>
- </li>
- <li>Expression with a superscript, <code>msup</code>:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <msup>
- <mi>x</mi>
- <mi>n</mi>
- </msup>
- </math>
- </li>
- <li>Expression with under- and overscript, <code>munderover</code>:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <munderover>
- <mo>∑</mo>
- <mrow>
- <mi>i</mi>
- <mo>=</mo>
- <mn>1</mn>
- </mrow>
- <mi>n</mi>
- </munderover>
- </math>
- </li>
- <li>Expression with underscript, <code>munder</code>:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <munder>
- <mi>x</mi>
- <mo>-</mo>
- </munder>
- </math>
- </li>
- <li>Expression with overscript, <code>mover</code>:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mi>x</mi>
- <mover>
- <mo>→</mo>
- <mtext>maps to</mtext>
- </mover>
- <mi>y</mi>
- </mrow>
- </math>
- </li>
- <li>Expression within parentheses, <code>mrow</code>:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mo fence="true">(</mo>
- <mrow>
- <mi>a</mi>
- <mo>+</mo>
- <mi>b</mi>
- </mrow>
- <mo fence="true">)</mo>
- </mrow>
- </math>
- </li>
- <li>Expression with prescripts and tensor
- indices,<code>mmultiscripts</code>:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mmultiscripts>
- <mi>X</mi>
- <mi>i</mi>
- <mi>j</mi>
- <mprescripts/>
- <mi>k</mi>
- <mi>l</mi>
- </mmultiscripts>
- </math>
- </li>
- <li>Matrix or table, <code>mtable</code>:
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mtable>
- <mtr>
- <mtd>
- <mi>a</mi>
- </mtd>
- <mtd>
- <mi>b</mi>
- </mtd>
- </mtr>
- <mtr>
- <mtd>
- <mi>c</mi>
- </mtd>
- <mtd>
- <mi>d</mi>
- </mtd>
- </mtr>
- </mtable>
- </math>
- </li>
- </ul>
-
- <p>The last item of the <strong>Math</strong> palette (
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mi>αβγ</mi>
- </math>
- ) displays another palette from which you can insert mathematical symbols and
- greek characters.</p>
-
- <h4><a name="Entering">Entering constructs from the keyboard</a></h4>
-
- <p>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 <strong>Math</strong> menu has a keyboard
- equivalent (all shortcuts are listed in the menu). This allows you to type
- faster.</p>
-
- <p>To type even faster, you may also use the keyboard to move the caret from a
- construct to another, with the arrow keys. The reight and left arrows move the
- caret according to the structure of the mathematical expression. For instance,
- in a fraction, when the caret is at the end of a numerator, key → moves
- it to the beginning of the denominator.</p>
-
- <h3><a name="Entering1">Entering characters</a></h3>
-
- <p>When you type a character string in a MathML element, Amaya parses that
- string and generates elements <code>mo</code> (operator), <code>mn</code>
- (number), <code>mi</code> (identifier), and <code>mtext</code> automatically.
- For instance, to enter</p>
-
- <p>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mi>x</mi>
- <mo>=</mo>
- <mn>2</mn>
- <mi>a</mi>
- <mo>+</mo>
- <mi>b</mi>
- </mrow>
- </math>
- </p>
-
- <p>just type this sequence of 6 characters: <code>x=2a+b</code> (don't forget
- to first click on the Math item of the <strong>Math</strong> menu, if you are
- not in a mathematical expression), and you will get the following structure
- (you can check in the <a href="#Math_Struc">Structure view</a>):</p>
- <pre><mi>x</mi><mo>=</mo><mn>2</mn><mi>a</mi><mo>+</mo><mi>b</mi></pre>
-
- <p>If the result is not exactly what you want, just select the characters that
- have been misinterpreted and change their type with one of the commands Plain
- text (mtext), Identifier (mi), Number (mn), Operator (mo) from the Types/Math
- menu.</p>
-
- <h3><a name="Structure">Structure editing</a></h3>
-
- <p>Amaya provides the same method to create and edit matrices as to <a
- href="Tables.html#Editing">edit HTML tables</a>. Like for tables there is a
- specific command (Delete matrix column) to delete a column in a matrix, even
- if it's not empty. This command is located at the end of
- submenu<strong>Math</strong> of menu <strong>Types</strong>.</p>
-
- <p>You may want to change the structure of an existing expression, e.g.
- appending a superscript or puting parentheses around an expression. To do
- that, just select the expression and enter the new construct with the palette,
- the <strong>Math</strong> menu or the <a href="#Entering">keyboard</a>. You
- can also use the <strong>Transform</strong> command from
- the<strong>Edit</strong> menu. Select the expression you want to transform and
- the <strong>Transform</strong> command will display a menu with all possible
- changes.</p>
-
- <h3><a name="Math_Struc">Structure view</a></h3>
-
- <p>Whenever a document contains some MathML elements, choosing the <a
- href="Views.html#Structure">Show Structure</a> item from
- the<strong>Views</strong> menu actually opens the Structure view which shows
- the main structure of the HTML document. In this view, the <code>math</code>
- tag and their actual contents is shown.</p>
-
- <p>You can edit math expressions either in the main view or in the Structure
- view. The Structure view is especially helpful to avoid ambiguity. Consider
- the following example:</p>
-
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mi>x</mi>
- <mo>=</mo>
- <msqrt>
- <mrow>
- <mi>a</mi>
- <mo>+</mo>
- <mi fontstyle="italic">b</mi>
- </mrow>
- </msqrt>
- <mo>+</mo>
- <mn>1</mn>
- </mrow>
- </math>
-
-
- <p>When moving the caret after character <em>b</em>, it is not clear whether
- you want to add something <em>within</em> the square root or <em>after</em>it.
- Selecting (or checking) in the Structure view avoids any ambiguity. You can
- also check the status line, at the bottom of the main window.</p>
-
- <h3><a name="Links">Links in MathML</a></h3>
-
- <p>You can create and use links in mathematical expressions. These links are
- represented using a draft version of the <a
- href="http://www.w3.org/TR/WD-xlink">XML Linking Language (XLink)</a>. 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:</p>
-
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mi>y</mi>
- <mo>=</mo>
- <mi></mi>
- <mfrac xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
- xlink:href="http://www.w3.org/">
- <mn>1</mn>
- <msqrt>
- <mrow>
- <msup>
- <mi>x</mi>
- <mn>2</mn>
- </msup>
- <mo>+</mo>
- <mn>1</mn>
- </mrow>
- </msqrt>
- </mfrac>
- </mrow>
- </math>
-
-
- <p>Double-clicking any character within the fraction fetches the W3C home
- page.</p>
-
- <p>(You can only find this in the structure view - it is not currently shown
- in the links view). To create such a link, just select an expression (the
- fraction in the above example), click on the Link button (or select "Create or
- change link" 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 <code>id</code> attribute for the target
- expression.</p>
-
- <h3><a name="Current">Current limitations</a></h3>
-
- <p>Amaya implements only the <em>Presentation Tags</em> from MathML 2.0, not
- the <em>Content Markup</em>. All presentation elements and attributes are
- available, but only the following attributes are rendered on the screen:
- <code>alttext</code>, <code>mathvariant</code>, <code>mathsize</code>,
- <code>mathcolor</code>, <code>mathbackground</code>, <code>fontsize</code>,
- <code>fontweight</code>, <code>fontstyle</code>, <code>fontfamily</code>,
- <code>color</code>, <code>linethickness</code>, <code>numalign</code>,
- <code>denomalign</code>, <code>bevelled</code>, <code>notation</code>,
- <code>lquote</code>, <code>rquote</code>, <code>lspace</code>,
- <code>rspace</code>, <code>subscriptshift</code>,
- <code>superscriptshift</code>, <code>form</code>, <code>width</code>
- (<code>mspace</code> only), <code>height</code> (<code>mspace</code> only),
- <code>depth</code> (<code>mspace</code> only), <code>align</code>,
- <code>rowalign</code>, <code>columnalign</code>, <code>frame</code>,
- <code>rowspan</code>, <code>columnspan</code>.</p>
-
- <p>The <code>class</code>, <code>id</code> and <code>style</code> attributes
- are available, with the same semantics as in HTML: you can <a
- href="StyleSheets.html">associate CSS style</a> with MathML elements
- (<code>class</code> and <code>style</code> attributes) and a MathML element
- can be the target of a link (<code>id</code> attribute).</p>
-
- <p>Due to the lack of mathematical fonts in the current version, only a
- limited set of entities representing math symbols are recognized, mainly those
- available in the Symbol font. The current version supports: Therefore,
- SuchThat, DownTee, Or, And, Not, Exists, ForAll, Element, NotElement,
- NotSubset, Subset, SubsetEqual, Superset, SupersetEqual, DoubleLeftArrow,
- DoubleLeftRightArrow, DoubleRightArrow, LeftArrow, LeftRightArrow, RightArrow,
- Congruent, GreaterEqual, le, NotEqual, Proportional, VerticalBar, Union,
- Intersection, PlusMinus, CirclePlus, Sum, Integral, CircleTimes, Product,
- CenterDot, Diamond, PartialD, DoubleDownArrow, DoubleUpArrow, DownArrow,
- UpArrow, ApplyFunction, TripleDot, DifferentialD, ImaginaryI, ExponentialE,
- InvisibleComma, UnderBar, OverBar, ThinSpace, ThickSpace, Hat, OverBar,
- UnderBar, prime, Prime.</p>
- </div>
-
- <p align="right"><a href="Tables.html"><img alt="previous" border="0"
- src="../Icons/left.gif" /></a><a href="Manual.html"><img alt="top" border="0"
- src="../Icons/up.gif" /></a><a href="SVG.html"><img alt="next" border="0"
- src="../Icons/right.gif" /></a></p>
- <hr />
- </body>
- </html>
-