Difference between revisions of "Math/basic"
m (→List of All Math macros: Added Category) |
m (→Introduction: Added examples for the Main Math page) |
||
Line 5: | Line 5: | ||
To tell TeX that an expression needs to be typeset using conventions for math, type the expression in <code>$</code>...<code>$</code>. For examples <code>$x$</code> gives | To tell TeX that an expression needs to be typeset using conventions for math, type the expression in <code>$</code>...<code>$</code>. For examples <code>$x$</code> gives | ||
<context>\setuplayout[scale=0.8]$x$</context>, while <code>$2$</code> gives <context>\setuplayout[scale=0.8]$2$</context>. Notice that the ''x'' is in italic while the ''2'' is upright. This is the usual mathematic convention. You can also write in the math mode using the command <cmd>math</cmd> or <cmd>mathematics</cmd>. | <context>\setuplayout[scale=0.8]$x$</context>, while <code>$2$</code> gives <context>\setuplayout[scale=0.8]$2$</context>. Notice that the ''x'' is in italic while the ''2'' is upright. This is the usual mathematic convention. You can also write in the math mode using the command <cmd>math</cmd> or <cmd>mathematics</cmd>. | ||
+ | |||
+ | Thus, the following three are equivalent. Use the style that you prefer. | ||
+ | |||
+ | <texcode> | ||
+ | Pythagoras formula, stating $a^2 + b^2 = c^2$ was one of the first trigonometric results | ||
+ | </texcode> | ||
+ | |||
+ | <texcode> | ||
+ | Pythagoras formula, stating \math{a^2 + b^2 = c^2} was one of the first trigonometric results | ||
+ | </texcode> | ||
+ | |||
+ | <texcode> | ||
+ | Pythagoras formula, stating \mathematics{a^2 + b^2 = c^2} was one of the first trigonometric results | ||
+ | </texcode> | ||
+ | and gives | ||
+ | <context> | ||
+ | \setuplayout[scale=0.8,width=13cm] | ||
+ | Pythagoras formula, stating $a^2 + b^2 = c^2$ was one of the first trigonometric results | ||
+ | </context> | ||
== Binary Operators Relations== | == Binary Operators Relations== |
Revision as of 19:46, 24 February 2007
<Math |
Contents
Introduction
To tell TeX that an expression needs to be typeset using conventions for math, type the expression in $
...$
. For examples $x$
gives
, while $2$
gives . Notice that the x is in italic while the 2 is upright. This is the usual mathematic convention. You can also write in the math mode using the command \math or \mathematics.
Thus, the following three are equivalent. Use the style that you prefer.
Pythagoras formula, stating $a^2 + b^2 = c^2$ was one of the first trigonometric results
Pythagoras formula, stating \math{a^2 + b^2 = c^2} was one of the first trigonometric results
Pythagoras formula, stating \mathematics{a^2 + b^2 = c^2} was one of the first trigonometric results
and gives
Binary Operators Relations
Basic binary symbols can be produced by typing the correspoding keyboard character. These include
+ - = < >
A general expressions can be input in the natural manner. For example $x+y$
gives . Notice that TeX took care of the spacing around +
. Mathematicians use a lot of symbols that are not avialable on the keyboard. TeX (and ConTeXt) provide macros to input them. For example $x \times y$
gives . The following is a parial list of frequently used binary operators and relations.
Commonly Used Binary Operators | Commonly used relation symbols | Set Relations | |||
---|---|---|---|---|---|
\pm | \leq | \subset | |||
\mp | \ll | \subseteq | |||
\times | \geq | \supset | |||
\div | \gg | \supseteq | |||
\ast | \equiv | \cap | |||
\star | \sim | \cup | |||
\bullet | \simeq | ||||
\circ | \approx | ||||
\cdot | \neq |
Greek Letters
To type the greek character α you can say $\alpha$
which gives . If you have a utf enabled keyboard, you can also type the α directly and ConTeXt will correctly interpret it. For example,
\enableregime[utf] Here is some Greek math $α^2 + β^2 = γ^2$
Here is a complete list of greek letters
lowercase greek letters | variation | uppercase greek letters | |||
---|---|---|---|---|---|
\alpha | |||||
\beta | |||||
\gamma | \Gamma | ||||
\delta | \Delta | ||||
\epsilon | \varepsilon | ||||
\zeta | |||||
\eta | |||||
\theta | \vartheta | \Theta | |||
\iota | |||||
\kappa | |||||
\lambda | \Lambda | ||||
\mu | |||||
\nu | |||||
\xi | \Xi | ||||
\omicron | |||||
\pi | \varpi | \Pi | |||
\rho | \varrho | ||||
\sigma | \varsigma | \Sigma | |||
\tau | |||||
\upsilon | \Upsilon | ||||
\phi | \Phi | ||||
\chi | |||||
\psi | \Psi | ||||
\omega | \Omega |
subscript and superscipt
TeX uses ^
and _
to denote superscipts and subscipts. It is perhaps easiest to explain this by means of some examples. is written as $x_{10}^{15}$
or $x^{15}_{10}$
. The order in which _
and ^
are given does not matter. One can also type complicated expressions like as $a_{b_{c_{d_{e}}}}$
.
List of All Math macros
In ConTeXt, you can see the list of all math macros by \showmathcharacters
Here is the first page of this list