-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo-mathematics.tex
165 lines (149 loc) · 3.18 KB
/
demo-mathematics.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
%
% THIS FILE DOES SOME UNUSUAL THINGS TO MAKE
% IT EASIER TO DO DEMONSTRATIONS. IT SHOULD
% NOT BE USED AS AN EXAMPLE OF HOW TO PREPARE
% A FILE. SEE THE OUTPUT OF THIS FOR LATEX
% INPUT AND OUTPUT EXAMPLES.
%
%
% demo-mathematics.tex 2008-12-09 Mark Senn http://engineering.purdue.edu/~mark
%
\chapter{Demonstrate Mathematics}
% Use single spacing.
\Baselinestretch{1}
% You don't normally need this.
\mbox{}
\begin{verbatim}
% From _More Math Into LaTeX_, 4th Edition, page 152:
% TeX uses $$ to open and close a displayed math environment.
% In LaTeX, this may occassionally cause problems. Don't do it.
\[
E = mc^2
\]
\end{verbatim}
% From _More Math Into LaTeX_, 4th Edition, page 152:
% TeX uses $$ to open and close a displayed math environment.
% In LaTeX, this may occassionally cause problems. Don't do it.
\[
E = mc^2
\]
\vskip\baselineskip
\hrule
\vskip0.5\baselineskip
\filbreak
\begin{verbatim}
\begin{equation}
E = mc^2
\end{equation}
\end{verbatim}
\begin{equation}
E = mc^2
\end{equation}
\vskip\baselineskip
\hrule
\vskip0.5\baselineskip
\filbreak
\begin{verbatim}
% Mydefs.tex defines \be to be \begin{equation} and
% \ee to be \end{equation}.
\be
E = mc^2
\ee
\end{verbatim}
% Mydefs.tex defines \be to be \begin{equation} and
% \ee to be \end{equation}.
\be
E = mc^2
\ee
\vskip\baselineskip
\hrule
\vskip0.5\baselineskip
\filbreak
\begin{verbatim}
\be
x = -\frac{b}{2a} \pm \frac{\sqrt{b^2 - 4ac}}{2a}
\ee
\end{verbatim}
\be
x = -\frac{b}{2a} \pm \frac{\sqrt{b^2 - 4ac}}{2a}
\ee
\vskip\baselineskip
\hrule
\vskip0.5\baselineskip
\filbreak
\begin{verbatim}
% requires \usepackage{amsmath}; use align* for no equation number
\begin{align}
a = {}& b + c\\
x = {}& y + z
\end{align}
\end{verbatim}
% requires \usepackage{amsmath}; use align* for no equation number
\begin{align}
a = {}& b + c\\
x = {}& y + z
\end{align}
\vskip\baselineskip
\hrule
\vskip0.5\baselineskip
\filbreak
\begin{verbatim}
\[
Z = \left(
\begin{array}{cc}
a& b\\
c& d
\end{array}
\right)
\]
\end{verbatim}
\[
Z = \left(
\begin{array}{cc}
a& b\\
c& d
\end{array}
\right)
\]
\vskip\baselineskip
\hrule
\vskip0.5\baselineskip
\filbreak
\begin{verbatim}
\begin{equation}
\begin{split}
a = {}& b + c\\
{}& + d + e
\end{split}
\end{equation}
\end{verbatim}
\begin{equation}
\begin{split}
a = {}& b + c\\
{}& + d + e
\end{split}
\end{equation}
\vskip\baselineskip
\hrule
\vskip0.5\baselineskip
\filbreak
\begin{verbatim}
\be
(\cos x)^2 + (\sin x)^2 = 1
\ee
\end{verbatim}
\be
(\cos x)^2 + (\sin x)^2 = 1
\ee
\vskip\baselineskip
\hrule
\vskip0.5\baselineskip
\filbreak
\begin{verbatim}
If $X = \cos x$ and $Y = \sin x$ then $X^2 + Y^2 = 1$.
\end{verbatim}
If $X = \cos x$ and $Y = \sin x$ then $X^2 + Y^2 = 1$.
\vskip\baselineskip
\hrule
\vskip0.5\baselineskip
\filbreak