The encoding is quite simple and flexible. All valid formulas have the form {-} , $OP(...) or a sequence of several such expressions seperated by operators. Here are some examples.
Ordinary InFix Expressions:
{a}, -{a}, {a}+{b}, {{a}+{b}-{d}}/{c}, {a}^{x}
{a} = {b}/{c}, {f({x}+{h})} apprx {2x}+{h}^{2}/{2}
Prefix Operators:
$I(a,b,f(x),dx),
$S(This is text converted to a math object),
$M([]C;1,2,3; 4,5,6; 7,8,9)
Combinations or Infix and Prefix:
$I(a,b, {sin(x)}/{x} , dx),
$M([]C;1,-{2},3; {a}+{5},5,6; 7,8,9)
Embedded text; Primitive Mathematical Expressions:
You can convert any text to a valid formula by enclosing it inside either $S(-) or {-}, as in
$S(The fat cat sat on the mat.), or $(This is text).The "$S(-)" option treats spacing in the same way as HTML, the {-} option ignores spacing. If you wish to include single mathematical operators within text, you should precede them by dollar signs and follow them by a space, as in $S(if x $> 5). You can also force spaces by inserting "$ " (dollar + space).
Notes
$operator(a,b),where "operator" is an operation (such as +, -, F, ^,...see the table below) and a and b are recursively defined valid formulas or just text. For example, $+(a,b) will return "a+b," and $F(a,b) will return "a/b" in fraction form. These are equivalent to the infiix {a}+{b} and {a}/{b} respectively.
The following table describes all the operations presently installed. Lowercase letters a,b,... stand for any recursively constructed formula (or just text when used as primitiv arguments in a prefix expression or within {-}).
Format | Example | |
Bracket | $B(a) | $B( {sin(x)}/{x} ) |
Fractions | $F(a,b) {a}/{b} |
$F(1, {2x}+{5}), {1}/{ {2x}+{5} } $F ($B ($F(x,y)),cx) {a}/$B({b}/{d}) |
Exponents Subscripts |
{a}^{b} or $^(a,b) {a}^{{b};#} or $^(a,b;#) {a}_{b} or or $_(a,b) {a}_{ {b};#} or $_(a,b;#) # = 0,1,2.. for additional offset (double-negative values (--#; do not use single negative) decrease offset) |
{e}^{3x} {e}^{{x}_{2};1} $^( e,$^(x,2 ) ;1 ) {e}^{-$I(p(x),dx) } |
Sum Difference Product Equals Notequal Approximately Less than, Greater Than Less or Equal,Greater or Equal |
{a}+{b} or $+(a,b) {a}-{b} or $-(a,b) {a}{b} or $.(a,b) {a} = {b} or $=(a,b) {a} notequal {b} or $notequal(a,b) {a} apprx {b} or $apprx(a,b) {a} < {b} or $<(a,b) {a} <= {b} or $<=(a,b) |
{1} = {2}-{1} {a}/{b} + {c} $F(a,b) + {c} $=(1,2x+5) $F ($- ($F(x,y),z),w) $F(a,b) = $F(c,d) +{a} {a}/{b} <= {e}^{x} -{a} |
Negative of expression a | -{a} or $-(,a) | -{4} {e}^$-(,$I(p(x),dx)) |
Radical | $R(a) $R(a;#) for #-th root |
$R({a}/{b} ) $R( $F(a,b) ; 4 ) |
Indefinite Integral Definite Integral |
$I(f,dx) $I(a,b,f,dx) |
$I($B($F(sin(x),x)),dx) $I(0,1,x2,dx) |
Matrix/Array of formulas | $M(LRA; a,b,c; d,e,f; g,h,i) L = [, {, |, or N (none) left border R = ], }, |, or N right border A = L (left), R (right) or C (center) alignment of entries rows seperated by semicolons entries in each row seperated by commas |
$M([]R; 1,2,$-(,3); 4,5,6) |
Commas, Spaces, Dollar Signs, Slashes | Since commas and dollar signs part of the syntax, and spaces are
ignored, you must precede these by $ signs if you want them to
work. For string expressions such as $S(the fat cat sat), the browser will handle the argument as it normally handles spaces. For extra space, include forced spaces. Do not use "$op" adjacent to infix operators, as this will conduse the interpreter. For example, use "{a$ }+{b}" for extra space after the "a", and not "{a} $ + {b}." |
$F(1$,000$,000,a) {a$ } + {$ b} for extra space in the expression "a+b" {Cost} = {$$46.43} $S(very $ $ $ widely $ $ $ spaced $ $ $ text) $S(the fraction a $/ b is represented as ) $F(a,b) |
Arrows | {a} -> {b} or $->(a,b) {a}<-{b} or $<-(a,b) {a}<->{b} or $<->(a,b) |
{F: $ } {R}^{n}->{R} {F(x)} = {x}^{2} |
Limits | $L(lim,{x} -> {a}), $L(lim,$->(x,a)) |
$L(lim,$->(x,a)){f(x)} = {L} |
Symbols, Greek: ![]() ![]() |
$infinity $pi |
{x} -> {$infinity} $I(-{$pi},{$pi},sin x,dx) = {0} |