home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 April / PCWorld_2001-04_cd.bin / Komunik / Amaya / WinNT2000 / amaya-WindowsNT-4.3.exe / _SETUP.1 / Math.html < prev    next >
Encoding:
Extensible Markup Language  |  2001-02-22  |  15.6 KB  |  433 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.   <title>Editing Mathematics</title>
  5.   <meta name="GENERATOR" content="amaya V4.2.2" />
  6.   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  7. </head>
  8.  
  9. <body xml:lang="en" lang="en">
  10.  
  11. <table border="0" width="100%" summary="toc">
  12.   <tbody>
  13.     <tr>
  14.       <td><img border="0" alt="W3C" src="../../Icons/WWW/w3c_home" /> <img
  15.         border="0" alt="Amaya" src="../Icons/amaya.gif" /></td>
  16.       <td><p align="right"><a href="Tables.html" accesskey="p"><img
  17.         alt="previous" border="0" src="../Icons/left.gif" /></a> <a
  18.         href="Manual.html" accesskey="t"><img alt="top" border="0"
  19.         src="../Icons/up.gif" /></a> <a href="SVG.html" accesskey="n"><img
  20.         alt="next" border="0" src="../Icons/right.gif" /></a></p>
  21.       </td>
  22.     </tr>
  23.     <tr>
  24.     </tr>
  25.   </tbody>
  26. </table>
  27.  
  28. <div id="Math">
  29. <h2>Editing mathematics</h2>
  30.  
  31. <p>Amaya allows you to include mathematical expressions in web pages,
  32. following the <a href="http://www.w3.org/TR/REC-MathML/">Mathematical Markup
  33. Language</a> (MathML) specification. Mathematical expressions are handled as
  34. structured components, in the same way as HTML elements. Therefore, you can
  35. manipulate math expressions in the same way you manipulate other parts of HTML
  36. documents. All editing commands provided by Amaya for handling text are also
  37. available for math, and there are some additional controls for entering
  38. mathematical constructs.</p>
  39.  
  40. <h3><a name="Creating">Creating a mathematical expression</a></h3>
  41.  
  42. <h4>The Math palette and the Types/Math menu</h4>
  43.  
  44. <p>To create a mathematical expression in a document, just <a
  45. href="Selecting.html#Selecting">move the insertion point</a> (the caret) to
  46. the position where you want to insert an expression, and then click
  47. the<strong>Math</strong> button <img src="../Icons/Math.gif" alt="Math" />, or
  48. select the <strong>Math</strong> entry from the <strong>Types</strong> menu.
  49. The <strong>Math</strong> button displays a palette that stays on the screen
  50. until you click its Done button. The item <strong>Math</strong> from
  51. the<strong>Types</strong> menu displays a popup menu. Just choose the most
  52. convenient tool for you. Both allow you to select the mathematical construct
  53. to be inserted.</p>
  54.  
  55. <p>In the Math palette (or menu) the first item allows you to create a new
  56. formula when the caret is in some HTML or <a href="SVG.html">SVG</a> element
  57. (but the caret should not be within a MathML element).</p>
  58.  
  59. <p>In the <strong>Math</strong> menu, the next items allow you to create new
  60. basic elements (not available in the palette): Plain text
  61. (<code>mtext</code>), Identifier (<code>mi</code>), Number (<code>mn</code>),
  62. Operator (<code>mo</code>). You can also use these commands to change the type
  63. of a single element or a sequence of elements.</p>
  64.  
  65. <p>These items in the <strong>Math</strong> menu are followed by the Character
  66. (<code>&xxx;</code>) item. This command allows you to enter a character
  67. that is not available on the keyboard. It displays a dialogue box where you
  68. have to enter the character name (for instance <em>alpha</em> for the greek
  69. character α).</p>
  70.  
  71. <p>The next items of the <strong>Math</strong> menu (or palette) allow you to
  72. create new constructs within a formula. If the caret is not in a formula,
  73. a<code>Math</code> element is created first to accept the new construct. The
  74. available constructs are:</p>
  75. <ul>
  76.   <li>Root with index, <code>mroot</code> in MathML: 
  77.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  78.       <mroot>
  79.         <mrow>
  80.           <mi>x</mi>
  81.           <mo>+</mo>
  82.           <mn>1</mn>
  83.         </mrow>
  84.         <mn>3</mn>
  85.       </mroot>
  86.     </math>
  87.   </li>
  88.   <li>Square root, <code>msqrt</code>: 
  89.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  90.       <msqrt>
  91.         <mrow>
  92.           <mi>x</mi>
  93.           <mo>+</mo>
  94.           <mn>1</mn>
  95.         </mrow>
  96.       </msqrt>
  97.     </math>
  98.   </li>
  99.   <li>Enclose, <code>menclose</code>: 
  100.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  101.       <menclose>
  102.         <mn>1234</mn>
  103.       </menclose>
  104.     </math>
  105.   </li>
  106.   <li>Fraction, <code>mfrac</code>: 
  107.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  108.       <mfrac>
  109.         <mn>1</mn>
  110.         <mrow>
  111.           <mi>x</mi>
  112.           <mo>+</mo>
  113.           <mn>1</mn>
  114.         </mrow>
  115.       </mfrac>
  116.     </math>
  117.   </li>
  118.   <li>Expression with subscript and superscript, <code>msubsup</code>: 
  119.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  120.       <msubsup>
  121.         <mi>x</mi>
  122.         <mrow>
  123.           <mi>i</mi>
  124.           <mo>+</mo>
  125.           <mn>1</mn>
  126.         </mrow>
  127.         <mi>n</mi>
  128.       </msubsup>
  129.     </math>
  130.     or 
  131.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  132.       <mrow>
  133.         <msubsup>
  134.           <mo>∫</mo>
  135.           <mn>0</mn>
  136.           <mo>∞</mo>
  137.         </msubsup>
  138.         <mi></mi>
  139.       </mrow>
  140.     </math>
  141.   </li>
  142.   <li>Expression with a subscript, <code>msub</code>: 
  143.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  144.       <msub>
  145.         <mi>x</mi>
  146.         <mi>i</mi>
  147.       </msub>
  148.     </math>
  149.   </li>
  150.   <li>Expression with a superscript, <code>msup</code>: 
  151.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  152.       <msup>
  153.         <mi>x</mi>
  154.         <mi>n</mi>
  155.       </msup>
  156.     </math>
  157.   </li>
  158.   <li>Expression with under- and overscript, <code>munderover</code>: 
  159.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  160.       <munderover>
  161.         <mo>∑</mo>
  162.         <mrow>
  163.           <mi>i</mi>
  164.           <mo>=</mo>
  165.           <mn>1</mn>
  166.         </mrow>
  167.         <mi>n</mi>
  168.       </munderover>
  169.     </math>
  170.   </li>
  171.   <li>Expression with underscript, <code>munder</code>: 
  172.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  173.       <munder>
  174.         <mi>x</mi>
  175.         <mo>-</mo>
  176.       </munder>
  177.     </math>
  178.   </li>
  179.   <li>Expression with overscript, <code>mover</code>: 
  180.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  181.       <mrow>
  182.         <mi>x</mi>
  183.         <mover>
  184.           <mo>→</mo>
  185.           <mtext>maps to</mtext>
  186.         </mover>
  187.         <mi>y</mi>
  188.       </mrow>
  189.     </math>
  190.   </li>
  191.   <li>Expression within parentheses, <code>mrow</code>: 
  192.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  193.       <mrow>
  194.         <mo fence="true">(</mo>
  195.         <mrow>
  196.           <mi>a</mi>
  197.           <mo>+</mo>
  198.           <mi>b</mi>
  199.         </mrow>
  200.         <mo fence="true">)</mo>
  201.       </mrow>
  202.     </math>
  203.   </li>
  204.   <li>Expression with prescripts and tensor
  205.     indices,<code>mmultiscripts</code>: 
  206.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  207.       <mmultiscripts>
  208.         <mi>X</mi>
  209.         <mi>i</mi>
  210.         <mi>j</mi>
  211.         <mprescripts/>
  212.         <mi>k</mi>
  213.         <mi>l</mi>
  214.       </mmultiscripts>
  215.     </math>
  216.   </li>
  217.   <li>Matrix or table, <code>mtable</code>: 
  218.     <math xmlns="http://www.w3.org/1998/Math/MathML">
  219.       <mtable>
  220.         <mtr>
  221.           <mtd>
  222.             <mi>a</mi>
  223.           </mtd>
  224.           <mtd>
  225.             <mi>b</mi>
  226.           </mtd>
  227.         </mtr>
  228.         <mtr>
  229.           <mtd>
  230.             <mi>c</mi>
  231.           </mtd>
  232.           <mtd>
  233.             <mi>d</mi>
  234.           </mtd>
  235.         </mtr>
  236.       </mtable>
  237.     </math>
  238.   </li>
  239. </ul>
  240.  
  241. <p>The last item of the <strong>Math</strong> palette ( 
  242. <math xmlns="http://www.w3.org/1998/Math/MathML">
  243.   <mi>αβγ</mi>
  244. </math>
  245. ) displays another palette from which you can insert mathematical symbols and
  246. greek characters.</p>
  247.  
  248. <h4><a name="Entering">Entering constructs from the keyboard</a></h4>
  249.  
  250. <p>You are not obliged to use a menu or a palette to create and edit
  251. mathematical expressions. You can enter mathematical constructs directly from
  252. the keyboard, as each item in the <strong>Math</strong> menu has a keyboard
  253. equivalent (all shortcuts are listed in the menu). This allows you to type
  254. faster.</p>
  255.  
  256. <p>To type even faster, you may also use the keyboard to move the caret from a
  257. construct to another, with the arrow keys. The reight and left arrows move the
  258. caret according to the structure of the mathematical expression. For instance,
  259. in a fraction, when the caret is at the end of a numerator, key → moves
  260. it to the beginning of the denominator.</p>
  261.  
  262. <h3><a name="Entering1">Entering characters</a></h3>
  263.  
  264. <p>When you type a character string in a MathML element, Amaya parses that
  265. string and generates elements <code>mo</code> (operator), <code>mn</code>
  266. (number), <code>mi</code> (identifier), and <code>mtext</code> automatically.
  267. For instance, to enter</p>
  268.  
  269. <p>
  270. <math xmlns="http://www.w3.org/1998/Math/MathML">
  271.   <mrow>
  272.     <mi>x</mi>
  273.     <mo>=</mo>
  274.     <mn>2</mn>
  275.     <mi>a</mi>
  276.     <mo>+</mo>
  277.     <mi>b</mi>
  278.   </mrow>
  279. </math>
  280. </p>
  281.  
  282. <p>just type this sequence of 6 characters: <code>x=2a+b</code> (don't forget
  283. to first click on the Math item of the <strong>Math</strong> menu, if you are
  284. not in a mathematical expression), and you will get the following structure
  285. (you can check in the <a href="#Math_Struc">Structure view</a>):</p>
  286. <pre><mi>x</mi><mo>=</mo><mn>2</mn><mi>a</mi><mo>+</mo><mi>b</mi></pre>
  287.  
  288. <p>If the result is not exactly what you want, just select the characters that
  289. have been misinterpreted and change their type with one of the commands Plain
  290. text (mtext), Identifier (mi), Number (mn), Operator (mo) from the Types/Math
  291. menu.</p>
  292.  
  293. <h3><a name="Structure">Structure editing</a></h3>
  294.  
  295. <p>Amaya provides the same method to create and edit matrices as to <a
  296. href="Tables.html#Editing">edit HTML tables</a>. Like for tables there is a
  297. specific command (Delete matrix column) to delete a column in a matrix, even
  298. if it's not empty. This command is located at the end of
  299. submenu<strong>Math</strong> of menu <strong>Types</strong>.</p>
  300.  
  301. <p>You may want to change the structure of an existing expression, e.g.
  302. appending a superscript or puting parentheses around an expression. To do
  303. that, just select the expression and enter the new construct with the palette,
  304. the <strong>Math</strong> menu or the <a href="#Entering">keyboard</a>. You
  305. can also use the <strong>Transform</strong> command from
  306. the<strong>Edit</strong> menu. Select the expression you want to transform and
  307. the <strong>Transform</strong> command will display a menu with all possible
  308. changes.</p>
  309.  
  310. <h3><a name="Math_Struc">Structure view</a></h3>
  311.  
  312. <p>Whenever a document contains some MathML elements, choosing the <a
  313. href="Views.html#Structure">Show Structure</a> item from
  314. the<strong>Views</strong> menu actually opens the Structure view which shows
  315. the main structure of the HTML document. In this view, the <code>math</code>
  316. tag and their actual contents is shown.</p>
  317.  
  318. <p>You can edit math expressions either in the main view or in the Structure
  319. view. The Structure view is especially helpful to avoid ambiguity. Consider
  320. the following example:</p>
  321.  
  322. <math xmlns="http://www.w3.org/1998/Math/MathML">
  323.   <mrow>
  324.     <mi>x</mi>
  325.     <mo>=</mo>
  326.     <msqrt>
  327.       <mrow>
  328.         <mi>a</mi>
  329.         <mo>+</mo>
  330.         <mi fontstyle="italic">b</mi>
  331.       </mrow>
  332.     </msqrt>
  333.     <mo>+</mo>
  334.     <mn>1</mn>
  335.   </mrow>
  336. </math>
  337.  
  338.  
  339. <p>When moving the caret after character <em>b</em>, it is not clear whether
  340. you want to add something <em>within</em> the square root or <em>after</em>it.
  341. Selecting (or checking) in the Structure view avoids any ambiguity. You can
  342. also check the status line, at the bottom of the main window.</p>
  343.  
  344. <h3><a name="Links">Links in MathML</a></h3>
  345.  
  346. <p>You can create and use links in mathematical expressions. These links are
  347. represented using a draft version of the <a
  348. href="http://www.w3.org/TR/WD-xlink">XML Linking Language (XLink)</a>. Only
  349. the simple unidirectional hyperlinks are available, but you can associate a
  350. link with any part of a formula. For example, the fraction in the formula
  351. below is a link to the W3C home page:</p>
  352.  
  353. <math xmlns="http://www.w3.org/1998/Math/MathML">
  354.   <mrow>
  355.     <mi>y</mi>
  356.     <mo>=</mo>
  357.     <mi></mi>
  358.     <mfrac xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
  359.     xlink:href="http://www.w3.org/">
  360.       <mn>1</mn>
  361.       <msqrt>
  362.         <mrow>
  363.           <msup>
  364.             <mi>x</mi>
  365.             <mn>2</mn>
  366.           </msup>
  367.           <mo>+</mo>
  368.           <mn>1</mn>
  369.         </mrow>
  370.       </msqrt>
  371.     </mfrac>
  372.   </mrow>
  373. </math>
  374.  
  375.  
  376. <p>Double-clicking any character within the fraction fetches the W3C home
  377. page.</p>
  378.  
  379. <p>(You can only find this in the structure view - it is not currently shown
  380. in the links view). To create such a link, just select an expression (the
  381. fraction in the above example), click on the Link button (or select "Create or
  382. change link" from the Links menu) and click on the desired target. If the
  383. target is an expression in a formula, you first have to turn that expression
  384. into a target. Just select the expression and select "Create target" from the
  385. Links menu. This creates an <code>id</code> attribute for the target
  386. expression.</p>
  387.  
  388. <h3><a name="Current">Current limitations</a></h3>
  389.  
  390. <p>Amaya implements only the <em>Presentation Tags</em> from MathML 2.0, not
  391. the <em>Content Markup</em>. All presentation elements and attributes are
  392. available, but only the following attributes are rendered on the screen:
  393. <code>alttext</code>, <code>mathvariant</code>, <code>mathsize</code>,
  394. <code>mathcolor</code>, <code>mathbackground</code>, <code>fontsize</code>,
  395. <code>fontweight</code>, <code>fontstyle</code>, <code>fontfamily</code>,
  396. <code>color</code>, <code>linethickness</code>, <code>numalign</code>,
  397. <code>denomalign</code>, <code>bevelled</code>, <code>notation</code>,
  398. <code>lquote</code>, <code>rquote</code>, <code>lspace</code>,
  399. <code>rspace</code>, <code>subscriptshift</code>,
  400. <code>superscriptshift</code>, <code>form</code>, <code>width</code>
  401. (<code>mspace</code> only), <code>height</code> (<code>mspace</code> only),
  402. <code>depth</code> (<code>mspace</code> only), <code>align</code>,
  403. <code>rowalign</code>, <code>columnalign</code>, <code>frame</code>,
  404. <code>rowspan</code>, <code>columnspan</code>.</p>
  405.  
  406. <p>The <code>class</code>, <code>id</code> and <code>style</code> attributes
  407. are available, with the same semantics as in HTML: you can <a
  408. href="StyleSheets.html">associate CSS style</a> with MathML elements
  409. (<code>class</code> and <code>style</code> attributes) and a MathML element
  410. can be the target of a link (<code>id</code> attribute).</p>
  411.  
  412. <p>Due to the lack of mathematical fonts in the current version, only a
  413. limited set of entities representing math symbols are recognized, mainly those
  414. available in the Symbol font. The current version supports: Therefore,
  415. SuchThat, DownTee, Or, And, Not, Exists, ForAll, Element, NotElement,
  416. NotSubset, Subset, SubsetEqual, Superset, SupersetEqual, DoubleLeftArrow,
  417. DoubleLeftRightArrow, DoubleRightArrow, LeftArrow, LeftRightArrow, RightArrow,
  418. Congruent, GreaterEqual, le, NotEqual, Proportional, VerticalBar, Union,
  419. Intersection, PlusMinus, CirclePlus, Sum, Integral, CircleTimes, Product,
  420. CenterDot, Diamond, PartialD, DoubleDownArrow, DoubleUpArrow, DownArrow,
  421. UpArrow, ApplyFunction, TripleDot, DifferentialD, ImaginaryI, ExponentialE,
  422. InvisibleComma, UnderBar, OverBar, ThinSpace, ThickSpace, Hat, OverBar,
  423. UnderBar, prime, Prime.</p>
  424. </div>
  425.  
  426. <p align="right"><a href="Tables.html"><img alt="previous" border="0"
  427. src="../Icons/left.gif" /></a><a href="Manual.html"><img alt="top" border="0"
  428. src="../Icons/up.gif" /></a><a href="SVG.html"><img alt="next" border="0"
  429. src="../Icons/right.gif" /></a></p>
  430. <hr />
  431. </body>
  432. </html>
  433.