HTML provides the possibility to format your text in a number of ways, such as italicizing, emboldening, writing as superscript or superscript etc. However it can be a bit of a chore writting all those tags, and the resulting source code is not particularly readable, so Mathyma provides format modifiers to achieve this more succinctly.
modifier | format | example | result |
^ | superscript | 10^2 |
10^2
|
_ | subscript | x_1 |
x_1
|
~ | italic | ~y |
~y
|
# | bold | #y |
#y
|
@ | cursive | @A |
@A
|
$ | overline | $x |
$x
|
To achieve the formatting, the format modifier must come immediately before the character (no spaces).
~x not ~ x
To format more than one character enclose the characters in brackets: { and } .
~{xyz}
Two or more format modifiers can be used together without brackets:
~#v_~i
This all means of course that the following characters have a special meaning in Mathyma:
{ | Used to open and close Mathyma template parameter lists, and delimit the span of super-/sub- scripts, bold and italics (see below) To display the characters "{" and "}" in your expressions use the symbols "&lbrk." and "&rbrk." , or use the escape-sequence (back-slash), i.e. "\{" and "\}" . |
} | |
^ | (hat) The character immediately following will be displayed as a superscript. If more than one character is to be displayed use "{" and "}" to enclose them. E.g. "x^{2n}" will give x2n. Note that even though there might only be one character displayed, if the Mathyma input is multi-character use brackets to enclose the string. For example write "x^{&beta.}" to get xβ To display "^" in your expressions use the symbol "&hat." , or "\^" . |
_ | (underscore) The character immediately following will be displayed as a subscript. Multiple characters should be enclosed in brackets, as for superscript. To display "_" in your expressions use the symbol "&uscore." , or "\_" . |
~ | (tilde) The character immediately following will be displayed as italic. Multiple characters should be enclosed in brackets, as for superscript. To display "~" in your expressions use the symbol "&tilde." , or "\~" . |
# | (hash) The character immediately following will be displayed as bold. Multiple characters should be enclosed in brackets, as for superscript. To display "#" in your expressions use the symbol "&hash." , or "\#" . |
@ | (at) The character immediately following will be displayed in cursive font. Multiple characters should be enclosed in brackets, as for superscript. To display "@" in your expressions use the symbol "&at." , or "\@" . |
$ | (dollar) The character immediately following will be overlined. Multiple characters should be enclosed in brackets, as for superscript. To display "$" in your expressions use the symbol "&dollar." , or "\$" . |
Combinations of the above special characters do not need to be bracketed separately, For example you write "~x^~n" to get xn, (i.e. it is not necessary to write "~x^{~n}"). Similarly write "#~{bold-italics}" to get bold-italics.
As mentioned elsewhere, Mathyma uses the "curly" brackets, "{" and "}" both to indicate that multiple characters are to be formatted, and to contain the arguments for a template
~x^{-1} fract{~a,~b}
In fact you can bracket any text in Mathyma, in most cases this will not have any effect, for example
this is just a {piece} of ~{text}
this is just a {piece} of ~{text} |
However there is one use of brackets which can be quite handy - and that is to prevent commas (and slashes in arrays and matrices) from being interpreted as argument separators. For example, suppose you want to get:
fract{{1,2},{3,4}} |
If you just wrote
fract{1,2,3,4}
Mathyma would consider "1" as the first parameter of the fract{} template and "2" as the second, and you would get:
fract{1,2,3,4} |
To get round this, enclose the "inner" commas in brackets (either themselves, or the whole argument):
fract{1{,}2,3{,}4} OR fract{{1,2},{3,4}}
In this way Mathyma recognizes that only the middle comma is at the right level to be an argument separator.