/
plotmath.tex
106 lines (85 loc) · 4.08 KB
/
plotmath.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
%%- \documentclass[a4paper,12pt]{article}
%%- \usepackage{a4}%------ ##--- (so I can print it '2on1' ...)
%%-
%%- \begin{document}
%%- \author{Paul Murrell \\ Statistics, Auckland, NZ}
%%- \date{Sept.~11, 1997}
%%-
%%- \title{Documentation for \\
%%- Mathematical Annotation in $R$}
%%- \maketitle
%%- \author{Paul Murrell \\ Statistics, Auckland, NZ}
%%- \date{Sept.~11, 1997}
%%-
%%- \title{%
%%- Documentation for \\
%%- Mathematical Annotation in $R$}
%%- \maketitle
\begin{center}\Large
Paul Murrell \\
Statistics, Auckland, NZ \\[2\parskip]
{Sept.~11, 1997}
\end{center}
If the {\tt text} argument to one of the text-drawing functions ({\tt
text}, {\tt mtext}, {\tt axis}) in \R\ is an expression, the argument
is interpreted as a mathematical expression and the output will be
formatted according to \TeX -like rules.
A mathematical expression must obey the normal rules of syntax for
any \R\ expression, but it is interpreted according to very
different rules than for normal \R\ expressions.
\begin{description}
\item[binary operators] addition, subtraction, multiplication, and
division use the standard \R\ syntax, although multiplication only
juxtaposes the arguments. For example, {\tt a+b}, {\tt a-b}, and {\tt
a/b}, produce $a+b$, $a-b$, and $a/b$, but {\tt a*b} produces $ab$.
\item[unary operators] positive and negative numbers are specified
with standard syntax. For example, {\tt +x} produces $+x$ and {\tt
-y} produces $-y$.
\item[subscripts and superscripts] a subscript is specified
using the subsetting syntax and a superscript is specified using
the power syntax. For example, {\tt x[i]} produces
$x_i$ and {\tt x\^{}2} produces $x^2$.
\item[accents] accented expressions are specified using the special
mathematical functions {\tt hat} and {\tt bar}. For example, {\tt
hat(x)} produces $\hat x$ and {\tt bar(x)} produces $\bar x$.
\item[fractions] fractions are specified using the special
mathematical function {\tt over}. For example, {\tt over(1,2)}
produces $1\over2$.
\item[relations] equality or assignment of terms is specified using
the {\tt ==} relation. For example, {\tt x == y} produces $x=y$.
\item[visible grouping] terms are visibly grouped by placing them
within parentheses. For example, {\tt (x+y)} produces $(x+y)$.
\item[invisible grouping] terms are invisibly grouped by placing
them within curly braces. For example {\tt x\^{}\{2*y\}} produces
$x^{2y}$, whereas {\tt x\^{}2*y} produces $x^2y$.
\item[big operators] a sum, product, or integral is specified using
the special mathematical function of the corresponding name. Each
of these functions takes three arguments; the first indicates what
is being summed/multiplied/integrated and the second and third specify
the limits of the summation/product/integral. For example, {\tt
sum(x[i], i==0, n)} produces $\sum\limits_{i=0}^n x_i$.
\item[radicals] a square root expression is specified using the
special mathematical functions {\tt root} and {\tt sqrt}. For
example, {\tt sqrt(x)} produces $\sqrt x$.
\item[absolute values] an absolute term is specified using the
special mathematical function {\tt abs}. For example, {\tt abs(x)}
produces $\left|x\right|$.
\item[juxtaposition] multiple terms are juxtaposed using the special
mathematical function {\tt paste}. For example, {\tt paste(over(b,
2), y, sum(x))} produces ${b\over2} y \sum x$.
\item[typeface changes] the default font in mathematical expressions
is italic (except for terms which are symbols). A new typeface is
specified using the special mathematical functions {\tt bold}, {\tt
italic}, {\tt plain}, and {\tt bolditalic}. For example, {\tt
plain(X)[i]} produces ${\rm X}_i$. These font specifications do not
accumulate (i.e., {\tt bold(italic(x)))} produces $x$ (an italic "x"),
whereas {\tt bolditalic(x)} produces \textit{\textbf{x}} (a bold, italic "x").
\item[general expressions] any functional expression which is not a
special mathematical function is simply reproduced as a function
expression. For example, {\tt foo(x)} produces $foo(x)$.
\end{description}
%%- \end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: Man.tex
%%% End: