home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="iso-8859-1"?>
- <?xml-stylesheet type="text/xsl" href="pmathml.xsl"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Editing Mathematics in Amaya</title>
- <link href="style.css" rel="stylesheet" type="text/css" />
- <style type="text/css">
- </style>
- </head>
-
- <body xml:lang="en" lang="en">
-
- <div>
- <img alt="Amaya" src="../../resources/icons/22x22/logo.png" class="logo" />
-
- <p class="nav"><a href="ImageMaps.html" accesskey="p"><img alt="previous"
- src="../../resources/icons/misc/left.png" /></a> <a href="Manual.html"
- accesskey="t"><img alt="top" src="../../resources/icons/misc/up.png" /></a>
- <a href="SVG.html" accesskey="n"><img alt="next"
- src="../../resources/icons/misc/right.png" /></a></p>
- </div>
-
- <div class="toc">
- <ul>
- <li><a href="#Editing">Editing Mathematics</a>
- <ul>
- <li><a href="#Entering">Entering Math Constructs using the
- Keyboard</a></li>
- <li><a href="#Creating">Creating a New Formula</a></li>
- <li><a href="#Math">Math Menus and Palette Commands</a></li>
- <li><a href="#Entering1">Entering Math Characters</a></li>
- <li><a href="#Spacing">Spacing</a></li>
- <li><a href="#Bracket">Bracket size</a></li>
- <li><a href="#Special">Special Characters</a></li>
- <li><a href="#Changing">Changing the Expression Structure</a></li>
- <li><a href="#Viewing">Viewing Structure in MathML</a></li>
- <li><a href="#Linking">Linking in MathML</a></li>
- <li><a href="#Known">Known Issues With MathML</a></li>
- </ul>
- </li>
- </ul>
- </div>
-
- <div id="page_body">
- <h2 id="Editing">Editing Mathematics</h2>
-
- <p>Amaya enables you to include mathematical expressions in web pages, using
- the Mathematical Markup Language (<a
- href="http://www.w3.org/TR/MathML2/">MathML</a>) specification.</p>
-
- <p>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. In addition,
- there are some other controls for entering mathematical constructs.</p>
-
- <h3 id="Entering">Entering Math Constructs using the Keyboard</h3>
-
- <p>You are not required to use the menus or the Math palette to create and
- edit mathematical expressions. You can enter mathematical constructs directly
- from the keyboard because each item in the Math menus has a keyboard
- equivalent. These shortcuts are listed on the menu and in the table below.</p>
-
- <p>You can also use the keyboard arrow keys to move the insertion point from
- one math construct to another. The right and left arrows move the insertion
- point according to the structure of the mathematical expression. For example,
- in a fraction when the insertion point is at the end of a numerator, the
- right arrow key moves the insertion point to the beginning of the
- denominator.</p>
-
- <table border="1">
- <tbody>
- <tr>
- <th>Action</th>
- <th>Shortcut</th>
- </tr>
- <tr>
- <td>New formula (math)</td>
- <td>Ctrl-m Ctrl-m</td>
- </tr>
- <tr>
- <td>Plain text (mtext)</td>
- <td>Ctrl-m Ctrl-x</td>
- </tr>
- <tr>
- <td>Identifier (mi)</td>
- <td>Ctrl-m Ctrl-d</td>
- </tr>
- <tr>
- <td>Number (mn)</td>
- <td>Ctrl-m Ctrl-n</td>
- </tr>
- <tr>
- <td>Operator (mo)</td>
- <td>Ctrl-m Ctrl-g</td>
- </tr>
- <tr>
- <td>Space (mspace)</td>
- <td>Ctrl-m Ctrl-Space</td>
- </tr>
- <tr>
- <td>Character (&xxx;)</td>
- <td>Ctrl-m Ctrl-e</td>
- </tr>
- <tr>
- <td>Invisible Times</td>
- <td>Ctrl-m Ctrl-i</td>
- </tr>
- <tr>
- <td>ApplyFunction</td>
- <td>Ctrl-m Ctrl-a</td>
- </tr>
- <tr>
- <td>Root (mroot)</td>
- <td>Ctrl-m Ctrl-r</td>
- </tr>
- <tr>
- <td>Square root (msqrt)</td>
- <td>Ctrl-m Ctrl-q</td>
- </tr>
- <tr>
- <td>Enclose (menclose)</td>
- <td>Ctrl-m Ctrl-c</td>
- </tr>
- <tr>
- <td>Fraction (mfrac)</td>
- <td>Ctrl-m Ctrl-f</td>
- </tr>
- <tr>
- <td>Subscript and superscript (msubsup)</td>
- <td>Ctrl-m Ctrl-b</td>
- </tr>
- <tr>
- <td>Subscript (msub)</td>
- <td>Ctrl-m Ctrl-v</td>
- </tr>
- <tr>
- <td>Superscript (msup)</td>
- <td>Ctrl-m Ctrl-6</td>
- </tr>
- <tr>
- <td>Under and over (munderover)</td>
- <td>Ctrl-m Ctrl-k</td>
- </tr>
- <tr>
- <td>Under (munder)</td>
- <td>Ctrl-m Ctrl-u</td>
- </tr>
- <tr>
- <td>Over (mover)</td>
- <td>Ctrl-m Ctrl-o</td>
- </tr>
- <tr>
- <td>Parentheses (mrow)</td>
- <td>Ctrl-m Ctrl-p</td>
- </tr>
- <tr>
- <td>Multiscripts (mmultiscripts)</td>
- <td>Ctrl-m Ctrl-s</td>
- </tr>
- <tr>
- <td>Matrix (mtable)</td>
- <td>Ctrl-m Ctrl-t</td>
- </tr>
- </tbody>
- </table>
-
- <h3 id="Creating">Creating a New Formula</h3>
-
- <p>To create a new mathematical expression in a document, move the mouse
- cursor to the position where you want to insert an expression, and then click
- the <strong>Math</strong> button from the Math palette, or choose <strong>New
- formula</strong> from the <strong>XML</strong> menu.</p>
-
- <h3 id="Math">Math Menus and Palette Commands</h3>
-
- <p>The <strong>XML/Basic math Elements</strong> menu contains elements which
- are not available from the palette. The first items include: Plain text
- (<code>mtext</code>), Identifier (<code>mi</code>), Number (<code>mn</code>),
- Operator (<code>mo</code>). These commands are used to create new elements in
- a mathematical expression. They can also change the type of a single element
- or a sequence of elements.</p>
-
- <p>The next command, Space (<code>mspace</code>), allows you to add space in
- a formula. Changing the value of the <strong>width</strong> attribute for
- this element allows you to set the width of the space.</p>
-
- <p id="next">The next item, Character (<code>&xxx;</code>) , enables you
- to enter a character that is not available on the keyboard. It displays a
- dialog where you have to enter the character name (for instance
- <code>alpha</code> for the Greek character α).</p>
-
- <p>Commands InvisibleTimes and ApplyFunction are used to enter the
- corresponding invisible characters.</p>
-
- <p>The <strong>XML/Math Constructions</strong> menu or the Math palette
- enable you to create new constructs within a formula. If the insertion point
- is not in a formula, Amaya first creates a <code>math</code> element 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>
- <mspace width=".2em"/>
- <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 largeop="true">∫</mo>
- <mn>0</mn>
- <mo>∞</mo>
- </msubsup>
- <mo> </mo>
- </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 movablelimits="false">∑</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>
- </ul>
-
- <p>The <strong>XML/Matrices</strong> menu allows you to create and edit
- matrices:</p>
- <ul>
- <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>You can create a matrix with the first command of this menu or with the
- corresponding button from the Math palette. You must then choose the number
- of lines and columns in the new matrix through a dialog that pops up. You can
- manipulate a matrix like a <a href="Tables.html">HTML table</a> through the
- commands available from the <strong>XML/Matrices</strong> menu.</p>
-
- <h3 id="Entering1">Entering Math Characters</h3>
-
- <p>When you type a character string in a MathML element, Amaya parses the
- string and automatically generates the elements <span class="code"><span
- style="font-size:11.0pt;font-family:"Courier New";">mo</span></span>
- (operator), <span class="code"><span
- style="font-size:11.0pt;font-family:"Courier New";">mn</span></span>
- (number), <span class="code"><span
- style="font-size:11.0pt;font-family:"Courier New";">mi</span></span>
- (identifier), and <span class="code"><span
- style="font-size:11.0pt;font-family:"Courier New";">mtext</span></span>.</p>
-
- <p>For example, to enter the formula <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>
- <ol>
- <li>If you are not in a mathematical expression, choose <strong>XML/New
- formula (math)</strong>.
- <p></p>
- </li>
- <li>Type this sequence of 6 characters: <code>x=2a+b</code></li>
- </ol>
-
- <p>Use the Structure or Source view to display the following structure
- generated by Amaya:</p>
-
- <p><code><mi>x</mi><mo>=</mo><mn>2</mn><mi>a</mi><mo>+</mo><mi>b</mi></code></p>
-
- <p>If the result is not exactly what you want, select the characters that
- were misinterpreted and change their type with one of the commands such as
- Plain text (<code>mtext</code>), Identifier (<code>mi</code>), Number
- (<code>mn</code>), Operator (<code>mo</code>) or Space (<code>mspace</code>)
- from the <strong>Basic math elements</strong> submenu of the
- <strong>XML</strong> menu.</p>
-
- <h3 id="Spacing">Spacing</h3>
-
- <p>Amaya takes care of spacing within math expressions, but in some cases you
- may need to add some additional space. Move the cursor to the position where
- you want to insert space and choose <strong>Basic math elements/Space
- (mspace)</strong> from the <strong>XML</strong> menu. This creates a default
- horizontal space. You can then change its <strong>width</strong> attribute to
- adjust its size or you can add other attributes (height, depth, linebreak) to
- change vertical spacing. Refer to the <a
- href="http://www.w3.org/TR/MathML2/chapter3.html#N9197">MathML
- specification</a> for more details.</p>
-
- <h3 id="Bracket">Bracket size</h3>
-
- <p>When entering brackets as in the following expression:</p>
-
- <p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mi>f</mi>
- <mrow>
- <mo>(</mo>
- <mi>x</mi>
- <mo>)</mo>
- </mrow>
- <mo>=</mo>
- <mfrac>
- <mn>1</mn>
- <mi>x</mi>
- </mfrac>
- </math></p>
-
- <p>typing the sequence <code>f(x)=</code> would lead to:</p>
-
- <p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mi>f</mi>
- <mo>(</mo>
- <mi>x</mi>
- <mo>)</mo>
- <mo>=</mo>
- <mfrac>
- <mn>1</mn>
- <mi>x</mi>
- </mfrac>
- </math></p>
-
- <p>Instead, choose <strong>Math Constructs/Parentheses</strong> from the
- <strong>XML</strong> menu or select the Parentheses option on the Maths
- palette to enter the parentheses properly.</p>
-
- <h3 id="Special">Special Characters</h3>
-
- <p>You can use the <strong><a href="#next">Character</a></strong> command
- from the <strong>XML/Basic Math Elements</strong> menu to enter mathematical
- characters and symbols that are not available on the keyboard. You can also
- use the <strong>Special Characters</strong> palette. The first two rows of
- buttons allow you to choose a group of characters, which are then available
- in the pull down below. Choose a character in the list and insert it in the
- formula by clicking the insertion button</p>
-
- <h3 id="Changing">Changing the Expression Structure</h3>
-
- <p>You may want to change the structure of an existing expression, such as
- appending a superscript, putting parentheses around an expression, or turning
- an expression into the numerator of a fraction. To do that, select the
- expression and enter the new construct with the palette, the <strong>XML/Math
- Constructs</strong> menu or the keyboard.</p>
-
- <p>You can also use <strong>Transform</strong> on the <strong>Edit</strong>
- menu. Select the expression you want to transform and
- <strong>Transform</strong> will display a menu with all possible changes.</p>
-
- <h3 id="Viewing">Viewing Structure in MathML</h3>
-
- <p>MathML structure in a document can be viewed by choosing <strong>Show
- Structure</strong> from the <strong>Views</strong> menu. Choosing this option
- opens the Structure view, which reveals the main structure of the document,
- the math elements, and their contents.</p>
-
- <p>Math expressions can be edited in the main view or in the Structure
- view.</p>
-
- <p>The Structure view is especially helpful to avoid ambiguity. For example,
- in the equation below, placing the cursor after characterô <math
- xmlns="http://www.w3.org/1998/Math/MathML">
- <mi>b</mi>
- </math>,ö it is not clear whether you wish to add something within the square
- root or after it.</p>
-
- <p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mi>x</mi>
- <mo>=</mo>
- <msqrt>
- <mi>a</mi>
- <mo>+</mo>
- <mi>b</mi>
- </msqrt>
- <mo>+</mo>
- <mn>1</mn>
- </math></p>
-
- <p>Selecting (or checking) in the Structure view avoids any misselections.
- You can also check the status line at the bottom of the main window.</p>
-
- <h3 id="Linking">Linking in MathML</h3>
-
- <p>You can create and use links in mathematical expressions. These links are
- represented using the XML Linking Language (XLink). Only simple
- unidirectional hyperlinks are available in Amaya, 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>
-
- <p><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mi>y</mi>
- <mo>=</mo>
- <mfrac xmlns:xlink="http://www.w3.org/1999/xlink"
- 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>
-
- <p>Double-clicking or right-clicking any character within the fraction loads
- the W3C home page.</p>
-
- <p>To create such a link, select a math expression (the fraction in the above
- example, for instance by clicking on the fraction bar), click the
- <strong>Link</strong> button from the XHTML palette (or choose <strong>Create
- or change link</strong> from the <strong>Links</strong> menu), and click the
- desired target.</p>
-
- <p>If the target is an expression in a formula, you must first turn the
- expression into a target. Select the expression and choose <strong>Create
- target</strong> from the <strong>Links</strong> menu to create an
- <code>id</code> attribute for the target expression.</p>
-
- <h3 id="Known">Known Issues With MathML</h3>
-
- <p>The following are known Amaya MathML issues:</p>
- <ul>
- <li>Amaya implements only the Presentation Tags from MathML 2.0, not the
- Content Markup. All presentation elements and attributes are available,
- but only the following attributes are rendered on the screen:
- <p><code>display, alttext, mathvariant, mathsize, mathcolor,
- mathbackground, fontsize, fontweight, fontstyle, fontfamily, color,
- linethickness, numalign, denomalign, bevelled, notation, lquote, rquote,
- lspace, rspace, largeop, movablelimits, subscriptshift, superscriptshift,
- form, width</code>(mspace only), <code>height</code> (mspace only),
- <code>depth</code> (mspace only), <code>align, rowalign, columnalign,
- frame, framespacing, displaystyle, side, rowspan, columnspan, rowspacing,
- columnspacing, rowlines, columnlines</code>.</p>
- </li>
- <li><span><span>The <code>class</code>, <code>id</code>, and
- <code>style</code> attributes are available, with the same semantics as
- in HTML: you can associate CSS styles 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).</span></span></li>
- </ul>
- </div>
- </body>
- </html>
-