Difference between revisions of "Math/basic"
(Added instructions to align superscripts/subscripts one after the other.) |
m (Text replacement - "<cmd>" to "{{cmd|") |
||
Line 4: | Line 4: | ||
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 | + | <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. | Thus, the following three are equivalent. Use the style that you prefer. | ||
Line 39: | Line 39: | ||
! colspan="2" | Set Relations | ! colspan="2" | Set Relations | ||
|- | |- | ||
− | | | + | |{{cmd|pm</cmd>||<context>$\pm$</context> |
− | | | + | |{{cmd|leq</cmd>||<context>$\leq$</context> |
− | | | + | |{{cmd|subset</cmd>||<context>$\subset$</context> |
|- | |- | ||
− | | | + | |{{cmd|mp</cmd>||<context>$\mp$</context> |
− | | | + | |{{cmd|ll</cmd>||<context>$\ll$</context> |
− | | | + | |{{cmd|subseteq</cmd>||<context>$\subseteq$</context> |
|- | |- | ||
− | | | + | |{{cmd|times</cmd>||<context>$\times$</context> |
− | | | + | |{{cmd|geq</cmd>||<context>$\geq$</context> |
− | | | + | |{{cmd|supset</cmd>||<context>$\supset$</context> |
|- | |- | ||
− | | | + | |{{cmd|div</cmd>||<context>$\div$</context> |
− | | | + | |{{cmd|gg</cmd>||<context>$\gg$</context> |
− | | | + | |{{cmd|supseteq</cmd>||<context>$\supseteq$</context> |
|- | |- | ||
− | | | + | |{{cmd|ast</cmd>||<context>$\ast$</context> |
− | | | + | |{{cmd|equiv</cmd>||<context>$\equiv$</context> |
− | | | + | |{{cmd|cap</cmd>||<context>$\cap$</context> |
|- | |- | ||
− | | | + | |{{cmd|star</cmd>||<context>$\star$</context> |
− | | | + | |{{cmd|sim</cmd>||<context>$\sim$</context> |
− | | | + | |{{cmd|cup</cmd>||<context>$\cup$</context> |
|- | |- | ||
− | | | + | |{{cmd|bullet</cmd>||<context>$\bullet$</context> |
− | | | + | |{{cmd|simeq</cmd>||<context>$\simeq$</context> |
− | | | + | |{{cmd|in</cmd>||<context>$\in$</context> |
|- | |- | ||
− | | | + | |{{cmd|circ</cmd>||<context>$\circ$</context> |
− | | | + | |{{cmd|approx</cmd>||<context>$\approx$</context> |
|- | |- | ||
− | | | + | |{{cmd|cdot</cmd>||<context>$\cdot$</context> |
− | | | + | |{{cmd|neq</cmd>||<context>$\neq$</context> |
|} | |} | ||
Line 91: | Line 91: | ||
! colspan="2" | uppercase greek letters | ! colspan="2" | uppercase greek letters | ||
|- | |- | ||
− | | | + | |{{cmd|alpha</cmd>||<context>$\alpha$</context> |
|- | |- | ||
− | | | + | |{{cmd|beta</cmd>||<context>$\beta$</context> |
|- | |- | ||
− | | | + | |{{cmd|gamma</cmd>||<context>$\gamma$</context> |
| | | | ||
| | | | ||
− | | | + | |{{cmd|Gamma</cmd>||<context>$\Gamma$</context> |
|- | |- | ||
− | | | + | |{{cmd|delta</cmd>||<context>$\delta$</context> |
| | | | ||
| | | | ||
− | | | + | |{{cmd|Delta</cmd>||<context>$\Delta$</context> |
|- | |- | ||
− | | | + | |{{cmd|epsilon</cmd>||<context>$\epsilon$</context> |
− | | | + | |{{cmd|varepsilon</cmd>||<context>$\varepsilon$</context> |
|- | |- | ||
− | | | + | |{{cmd|zeta</cmd>||<context>$\zeta$</context> |
|- | |- | ||
− | | | + | |{{cmd|eta</cmd>||<context>$\eta$</context> |
|- | |- | ||
− | | | + | |{{cmd|theta</cmd>||<context>$\theta$</context> |
− | | | + | |{{cmd|vartheta</cmd>||<context>$\vartheta$</context> |
− | | | + | |{{cmd|Theta</cmd>||<context>$\Theta$</context> |
|- | |- | ||
− | | | + | |{{cmd|iota</cmd>||<context>$\iota$</context> |
|- | |- | ||
− | | | + | |{{cmd|kappa</cmd>||<context>$\kappa$</context> |
|- | |- | ||
− | | | + | |{{cmd|lambda</cmd>||<context>$\lambda$</context> |
| | | | ||
| | | | ||
− | | | + | |{{cmd|Lambda</cmd>||<context>$\Lambda$</context> |
|- | |- | ||
− | | | + | |{{cmd|mu</cmd>||<context>$\mu$</context> |
|- | |- | ||
− | | | + | |{{cmd|nu</cmd>||<context>$\nu$</context> |
|- | |- | ||
− | | | + | |{{cmd|xi</cmd>||<context>$\xi$</context> |
| | | | ||
| | | | ||
− | | | + | |{{cmd|Xi</cmd>||<context>$\Xi$</context> |
|- | |- | ||
− | | | + | |{{cmd|omicron</cmd>||<context>$\omicron$</context> |
|- | |- | ||
− | | | + | |{{cmd|pi</cmd>||<context>$\pi$</context> |
− | | | + | |{{cmd|varpi</cmd>||<context>$\varpi$</context> |
− | | | + | |{{cmd|Pi</cmd>||<context>$\Pi$</context> |
|- | |- | ||
− | | | + | |{{cmd|rho</cmd>||<context>$\rho$</context> |
− | | | + | |{{cmd|varrho</cmd>||<context>$\varrho$</context> |
|- | |- | ||
− | | | + | |{{cmd|sigma</cmd>||<context>$\sigma$</context> |
− | | | + | |{{cmd|varsigma</cmd>||<context>$\varsigma$</context> |
− | | | + | |{{cmd|Sigma</cmd>||<context>$\Sigma$</context> |
|- | |- | ||
− | | | + | |{{cmd|tau</cmd>||<context>$\tau$</context> |
|- | |- | ||
− | | | + | |{{cmd|upsilon</cmd>||<context>$\upsilon$</context> |
| | | | ||
| | | | ||
− | | | + | |{{cmd|Upsilon</cmd>||<context>$\Upsilon$</context> |
|- | |- | ||
− | | | + | |{{cmd|phi</cmd>||<context>$\phi$</context> |
| | | | ||
| | | | ||
− | | | + | |{{cmd|Phi</cmd>||<context>$\Phi$</context> |
|- | |- | ||
− | | | + | |{{cmd|chi</cmd>||<context>$\chi$</context> |
|- | |- | ||
− | | | + | |{{cmd|psi</cmd>||<context>$\psi$</context> |
| | | | ||
| | | | ||
− | | | + | |{{cmd|Psi</cmd>||<context>$\Psi$</context> |
|- | |- | ||
− | | | + | |{{cmd|omega</cmd>||<context>$\omega$</context> |
| | | | ||
| | | | ||
− | | | + | |{{cmd|Omega</cmd>||<context>$\Omega$</context> |
|} | |} | ||
Line 181: | Line 181: | ||
== List of All Math macros == | == List of All Math macros == | ||
− | In ConTeXt MkII, you can see the list of all math macros by | + | In ConTeXt MkII, you can see the list of all math macros by {{cmd|showmathcharacters</cmd>. |
− | In MkIV, \usemodule[fnt-25] followed by | + | In MkIV, \usemodule[fnt-25] followed by {{cmd|showmathfontcharacters</cmd> produces a lengthy annotated catalogue. |
Here is the first page of this list | Here is the first page of this list |
Revision as of 13:20, 9 August 2020
<Math |
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 {{cmd|math</cmd> or {{cmd|mathematics</cmd>.
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</cmd> | leq</cmd> | subset</cmd> | |||
mp</cmd> | ll</cmd> | subseteq</cmd> | |||
times</cmd> | geq</cmd> | supset</cmd> | |||
div</cmd> | gg</cmd> | supseteq</cmd> | |||
ast</cmd> | equiv</cmd> | cap</cmd> | |||
star</cmd> | sim</cmd> | cup</cmd> | |||
bullet</cmd> | simeq</cmd> | in</cmd> | |||
circ</cmd> | approx</cmd> | ||||
cdot</cmd> | neq</cmd> |
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</cmd> | |||||
beta</cmd> | |||||
gamma</cmd> | Gamma</cmd> | ||||
delta</cmd> | Delta</cmd> | ||||
epsilon</cmd> | varepsilon</cmd> | ||||
zeta</cmd> | |||||
eta</cmd> | |||||
theta</cmd> | vartheta</cmd> | Theta</cmd> | |||
iota</cmd> | |||||
kappa</cmd> | |||||
lambda</cmd> | Lambda</cmd> | ||||
mu</cmd> | |||||
nu</cmd> | |||||
xi</cmd> | Xi</cmd> | ||||
omicron</cmd> | |||||
pi</cmd> | varpi</cmd> | Pi</cmd> | |||
rho</cmd> | varrho</cmd> | ||||
sigma</cmd> | varsigma</cmd> | Sigma</cmd> | |||
tau</cmd> | |||||
upsilon</cmd> | Upsilon</cmd> | ||||
phi</cmd> | Phi</cmd> | ||||
chi</cmd> | |||||
psi</cmd> | Psi</cmd> | ||||
[[Command/omega</cmd>|\omega</cmd>]]$.
To align superscripts and subscripts one after the other (not above/below each other), add empty braces List of All Math macrosIn ConTeXt MkII, you can see the list of all math macros by {{cmd|showmathcharacters</cmd>. In MkIV, \usemodule[fnt-25] followed by {{cmd|showmathfontcharacters</cmd> produces a lengthy annotated catalogue. Here is the first page of this list
|