Since NDA* Portal.com is meant to hold and display scientific content, which usually includes mathematical formulas, here we describe how to enter good looking expressions that can be displayed on your browser. To make this possible, NDA* Portal.com uses the advanced Math features of MathML*, Math Meta Language, which is nowdays supported by many browsers. To have more details on what is MathML*, you can go to the World Wide Web Consortium (W3C) website at the page on MathML or visit the Mozilla website on MathML* support here.
The capability to write formulas in NDA* Portal.com is made possible thanks to the ASCIIMathML JavaScript, written by prof. Peter Jipsen. More details can be found here or in the author's website.
However, to start using formulas, your browser should satisfy some requirements.
Requirements
For Internet Explorer version 6 and above:
- To have MathML* work on your IE installation, you have to download the free MathML Player plugin, which installs the necessary extensions and fonts to render math formulas correctly.
- Once you have installed the plugin, just restart your browser and you'll be able to see formulas.
For Mozilla/Firefox/Netscape 7.1:
- These browsers support MathML* natively, in contrast to IE which needs an external plugin. However to better support the display (rendering) of mathematical formulas some additional fonts are required.
- To download the necessary fonts you can go to http://www.mozilla.org/projects/mathml/fonts/ where you will find all the necessary informations.
- You should not need to restart your browser, but it can help to do so.
At the moment we don't have any feedback about other browsers. If you have another browser or useful information on this topic, please contact us to admin@ndaportal.com.
Examples
Example: Solving the quadratic equation.
Suppose $ax^2+bx+c=0$ and $a!=0$. We first
divide by $a$ to get $x^2+b/ax+c/a=0$.
Then we complete the square and obtain $x^2+b/ax+(b/(2a))^2-(b/(2a))^2+c/a=0$.
The first three terms factor to give $(x+b/(2a))^2=(b^2)/(4a^2)-c/a$.
Now we take square roots on both sides and get $x+b/(2a)=+-sqrt((b^2)/(4a^2)-c/a)$.
Finally we move the $b/(2a)$ to the right and simplify to get the two solutions: $x_(1,2)=(-b+-sqrt(b^2 - 4ac))/(2a)$
Here is the text that was typed in:
Example: Solving the quadratic equation.
Suppose $ax^2+bx+c=0$ and $a!=0$.
We first divide by $a$ to get $x^2+b/ax+c/a=0$.
Then we complete the square and obtain
$x^2+b/ax+(b/(2a))^2-(b/(2a))^2+c/a=0$.
The first three terms factor to give $(x+b/(2a))^2=(b^2)/(4a^2)-c/a$.
Now we take square roots on both sides and get
$x+b/(2a)=+-sqrt((b^2)/(4a^2)-c/a)$.
Finally we move the $b/(2a)$ to the right and simplify to get
the two solutions: $x_(1,2)=(-b+-sqrt(b^2-4ac))/(2a)$
Syntax
The syntax used to enter mathematical formula uses the standards of the ASCIIMathML script engine. The main features of this engine are here reported. For further information on what is ASCIIMathML you can go to its homepage.
The main aims of the ASCIIMathML syntax are:
- close to standard mathematical notation
- easy to read
- 3. easy to type
You can use the rich text editor provided by NDA* Portal.com. If the page is viewed by a browser that does not support MathML* or JavaScript, the ASCII formulas are still quite readable. Most users will not have to read the technicalities on this page. If you type
$x^2$ or $a_(mn)$ or $a_{mn}$ or $(x+1)/y$ or $sqrtx$
you pretty much get what you expect: `x^2` or `a_(mn)` or `a_{mn}` or `(x+1)/y` or `sqrtx`. The choice of grouping parenthesis is up to you (they don't have to match either). If the displayed expression can be parsed uniquely without them, they are omitted. Printing the table of constant symbols (below) may be helpful (but is not necessary if you know the LaTeX equivalents).
The remainder of this page gives a fairly detailed specification of the ASCII syntax.
The expressions described here correspond to a wellspecified subset of Presentation MathML* and behave in a predictable way.
The syntax is very permissive and does not generate syntax errors. This allows mathematically incorrect expressions to be displayed.
The parser uses no operator precedence and only respects the grouping brackets, subscripts, superscript, fractions and (square) roots. This is done for reasons of efficiency and generality. The resulting MathML* code can quite easily be processed further to ensure additional syntactic requirements of any particular application.
The grammar: Here is a definition of the grammar used to parse ASCIIMathML expressions. In the Backus-Naur form given below, the letter on the left of the ::= represents a category of symbols that could be one of the possible sequences of symbols listed on the right. The vertical bar | separates the alternatives.
c ::= [A-z] | numbers | greek letters | other constant symbols (see below)
u ::= 'sqrt' | 'text' | 'bb' | other unary symbols for font commands
b ::= 'frac' | 'root' | 'stackrel' binary symbols
l ::= ( | [ | { | (: | {: left brackets
r ::= ) | ] | } | :) | :} right brackets
S ::= c | lEr | uS | bSS | "any" simple expression
E ::= SE | S/S |S_S | S^S | S_S^S expression (fraction, sub-, super-, subsuperscript)
The translation rules: Each terminal symbol is translated into a corresponding MathML
* node. The constants are mostly converted to their respective Unicode symbols. The other expressions are converted as follows:
| l`S`r | `to` | <mrow>l`S`r</mrow> (note that any pair of brackets can be used to delimit subexpressions, they don't have to match) |
| sqrt `S` | `to` | <msqrt>`S'`</msqrt> |
| text `S` | `to` | <mtext>`S'`</mtext> |
| "any" | `to` | <mtext>any</mtext> |
| frac `S_1` `S_2` | `to` | <mfrac>`S_1'` `S_2'`</mfrac> |
| root `S_1` `S_2` | `to` | <mroot>`S_2'` `S_1'`</mroot> |
| stackrel `S_1` `S_2` | `to` | <mover>`S_2'` `S_1'`</mover> |
| `S_1`/`S_2` | `to` | <mfrac>`S_1'` `S_2'`</mfrac> |
| `S_1`_`S_2` | `to` | <msub>`S_1` `S_2'`</msub> |
| `S_1`^`S_2` | `to` | <msup>`S_1` `S_2'`</msup> |
| `S_1`_`S_2`^`S_3` | `to` | <msubsup>`S_1` `S_2'` `S_3'`</msubsup> or <munderover>`S_1` `S_2'` `S_3'`</munderover> (in some cases) |
In the rules above, the expression `S'` is the same as `S`, except that if `S` has an outer level of brackets, then `S'` is the expression inside these brackets.
Matrices: A simple syntax for matrices is also recognized:
l(`S_(11)`,...,`S_(1n)`),(...),(`S_(m1)`,...,`S_(mn)`)r or l[`S_(11)`,...,`S_(1n)`],[...],[`S_(m1)`,...,`S_(mn)`]r.
Here l and r stand for any of the left and right brackets (just like in the grammar they do not have to match). Both of these expressions are translated to
<mrow>l<mtable><mtr><mtd>`S_(11)`</mtd>... <mtd>`S_(1n)`</mtd></mtr>... <mtr><mtd>`S_(m1)`</mtd>... <mtd>`S_(mn)`</mtd></mtr></mtable>r</mrow>.
For example {(S_(11),...,S_(1n)),(,...,),(S_(m1),...,S_(mn))] displays as `{(S_(11),...,S_(1n)),(,...,),(S_(m1),...,S_(mn))]`.
Note that each row must have the same number of expressions, and there should be at least two rows.
Spaces are significant when they separate characters and thus prevent a certain string of characters from matching one of the constants. Multiple spaces and end-of-line characters are equivalent to a single space.
For a complete list of constants (standard LaTeX names also work):
- Numbers: A string of digits, optionally preceded by a minus sign, and optionally followed by a decimal point (a period) and another string of digits, is parsed as a single token and converted to a MathML* number, i.e., enclosed with the <mn> tag. If it is not desirable to have a preceding minus sign be part of the number, a space should be inserted. Thus x-1 is converted to <mi>x</mi><mn>-1</mn>, whereas x - 1 is converted to <mi>x</mi><mo>-</mo><mn>1</mn>.
- Greek letters: alpha `alpha` beta `beta` chi `chi` delta `delta` Delta `Delta` epsilon `epsilon` varepsilon `varepsilon` eta `eta` gamma `gamma` Gamma `Gamma` iota `iota` kappa `kappa` lambda `lambda` Lambda `Lambda` mu `mu` nu `nu` omega `omega` Omega `Omega` phi `phi` varphi `varphi` Phi `Phi` pi `pi` Pi `Pi` psi `psi` Psi `Psi` rho `rho` sigma `sigma` Sigma `Sigma` tau `tau` theta `theta` vartheta `vartheta` Theta `Theta` upsilon `upsilon` xi `xi` Xi `Xi` zeta `zeta`
Operation symbols | Type | See | | + | `+` | | - | `-` | | * | `*` | | ** | `**` | | // | `//` | | \\ | `\\ ` | | xx | `xx` | | -: | `-:` | | @ | `@` | | o+ | `o+` | | ox | `ox` | | o. | `o.` | | sum | `sum` | | prod | `prod` | | ^^ | `^^` | | ^^^ | `^^^` | | vv | `vv` | | vvv | `vvv` | | nn | `nn` | | nnn | `nnn` | | uu | `uu` | | uuu | `uuu` | | Relation symbols | Type | See | | = | `=` | | != | `!=` | | lt | `lt` | | > | `>` | | lt= | `lt=` | | >= | `>=` | | -lt | `-lt` | | >- | `>-` | | in | `in` | | !in | `notin` | | sub | `sub` | | sup | `sup` | | sube | `sube` | | supe | `supe` | | -= | `-=` | | ~= | `~=` | | ~~ | `~~` | | prop | `prop` | | Logical symbols | Type | See | | and | `and` | | or | `or` | | not | `not` | | => | `=>` | | if | `if` | | iff | `iff` | | AA | `AA` | | EE | `EE` | | _|_ | `_|_` | | TT | `TT` | | |-- | `|--` | | |== | `|==` | Grouping brackets | Type | See | | ( | `(` | | ) | `)` | | [ | `[` | | ] | `]` | | { | `{` | | } | `}` | | (: | `(:` | | :) | `:)` | | {: | `{:` | | :} | `{::}` | |
Miscellaneous symbols | Type | See | | int | `int` | | oint | `oint` | | del | `del` | | grad | `grad` | | +- | `+-` | | O/ | `O/` | | oo | `oo` | | aleph | `aleph` | | /_ | `/_` | | :. | `:.` | | |...| | |`...`| | | |cdots| | |`cdots`| | | |\ | | |`\ `| | | |quad| | |`quad`| | | diamond | `diamond` | | square | `square` | | |__ | `|__` | | __| | `__|` | | |~ | `|~` | | ~| | `~|` | | CC | `CC` | | NN | `NN` | | QQ | `QQ` | | RR | `RR` | | ZZ | `ZZ` | | Standard functions | Type | See | | sin | `sin` | | cos | `cos` | | tan | `tan` | | csc | `csc` | | sec | `sec` | | cot | `cot` | | sinh | `sinh` | | cosh | `cosh` | | tanh | `tanh` | | log | `log` | | ln | `ln` | | det | `det` | | dim | `dim` | | lim | `lim` | | mod | `mod` | | gcd | `gcd` | | lcm | `lcm` | | min | `min` | | max | `max` | Accents | Type | See | | hat x | `hat x` | | bar x | `bar x` | | ul x | `ul x` | | vec x | `vec x` | | dot x | `dot x` | | ddot x | `ddot x` | | Arrows | Type | See | | uarr | `uarr` | | darr | `darr` | | rarr | `rarr` | | -> | `->` | | larr | `larr` | | harr | `harr` | | rArr | `rArr` | | lArr | `lArr` | | hArr | `hArr` | Font commands | Type | See | | bb A | `bb A` | | bbb A | `bbb A` | | cc A | `cc A` | | tt A | `tt A` | | fr A | `fr A` | | sf A | `sf A` | |