##// END OF EJS Templates
Fix "Source" text for the "Other Syntax" section of the notebook...
Carlos Cordoba -
Show More
@@ -1,259 +1,260 b''
1 1 {
2 2 "metadata": {
3 3 "name": ""
4 4 },
5 5 "nbformat": 3,
6 6 "nbformat_minor": 0,
7 7 "worksheets": [
8 8 {
9 9 "cells": [
10 10 {
11 11 "cell_type": "markdown",
12 12 "metadata": {},
13 13 "source": [
14 14 "The Markdown parser included in IPython is MathJax-aware. This means that you can freely mix in mathematical expressions using the [MathJax subset of Tex and LaTeX](http://docs.mathjax.org/en/latest/tex.html#tex-support). [Some examples from the MathJax site](http://www.mathjax.org/demos/tex-samples/) are reproduced below, as well as the Markdown+TeX source."
15 15 ]
16 16 },
17 17 {
18 18 "cell_type": "markdown",
19 19 "metadata": {},
20 20 "source": [
21 21 "# Motivating Examples\n",
22 22 "\n",
23 23 "---\n",
24 24 "\n",
25 25 "## The Lorenz Equations\n",
26 26 "### Source\n",
27 27 "```\\begin{align}\n",
28 28 "\\dot{x} & = \\sigma(y-x) \\\\\n",
29 29 "\\dot{y} & = \\rho x - y - xz \\\\\n",
30 30 "\\dot{z} & = -\\beta z + xy\n",
31 31 "\\end{align}\n",
32 32 "```\n",
33 33 "### Display\n",
34 34 "\\begin{align}\n",
35 35 "\\dot{x} & = \\sigma(y-x) \\\\\n",
36 36 "\\dot{y} & = \\rho x - y - xz \\\\\n",
37 37 "\\dot{z} & = -\\beta z + xy\n",
38 38 "\\end{align}"
39 39 ]
40 40 },
41 41 {
42 42 "cell_type": "markdown",
43 43 "metadata": {},
44 44 "source": [
45 45 "## The Cauchy-Schwarz Inequality\n",
46 46 "### Source\n",
47 47 "```\\begin{equation*}\n",
48 48 "\\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\leq \\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right)\n",
49 49 "\\end{equation*}\n",
50 50 "```\n",
51 51 "### Display\n",
52 52 "\\begin{equation*}\n",
53 53 "\\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\leq \\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right)\n",
54 54 "\\end{equation*}"
55 55 ]
56 56 },
57 57 {
58 58 "cell_type": "markdown",
59 59 "metadata": {},
60 60 "source": [
61 61 "## A Cross Product Formula\n",
62 62 "### Source\n",
63 63 "```\\begin{equation*}\n",
64 64 "\\mathbf{V}_1 \\times \\mathbf{V}_2 = \\begin{vmatrix}\n",
65 65 "\\mathbf{i} & \\mathbf{j} & \\mathbf{k} \\\\\n",
66 66 "\\frac{\\partial X}{\\partial u} & \\frac{\\partial Y}{\\partial u} & 0 \\\\\n",
67 67 "\\frac{\\partial X}{\\partial v} & \\frac{\\partial Y}{\\partial v} & 0\n",
68 68 "\\end{vmatrix} \n",
69 69 "\\end{equation*}\n",
70 70 "```\n",
71 71 "### Display\n",
72 72 "\\begin{equation*}\n",
73 73 "\\mathbf{V}_1 \\times \\mathbf{V}_2 = \\begin{vmatrix}\n",
74 74 "\\mathbf{i} & \\mathbf{j} & \\mathbf{k} \\\\\n",
75 75 "\\frac{\\partial X}{\\partial u} & \\frac{\\partial Y}{\\partial u} & 0 \\\\\n",
76 76 "\\frac{\\partial X}{\\partial v} & \\frac{\\partial Y}{\\partial v} & 0\n",
77 77 "\\end{vmatrix} \n",
78 78 "\\end{equation*}"
79 79 ]
80 80 },
81 81 {
82 82 "cell_type": "markdown",
83 83 "metadata": {},
84 84 "source": [
85 85 "## The probability of getting \\(k\\) heads when flipping \\(n\\) coins is\n",
86 86 "### Source\n",
87 87 "```\\begin{equation*}\n",
88 88 "P(E) = {n \\choose k} p^k (1-p)^{ n-k} \n",
89 89 "\\end{equation*}\n",
90 90 "```\n",
91 91 "### Display\n",
92 92 "\\begin{equation*}\n",
93 93 "P(E) = {n \\choose k} p^k (1-p)^{ n-k} \n",
94 94 "\\end{equation*}"
95 95 ]
96 96 },
97 97 {
98 98 "cell_type": "markdown",
99 99 "metadata": {},
100 100 "source": [
101 101 "## An Identity of Ramanujan\n",
102 102 "### Source\n",
103 103 "```\\begin{equation*}\n",
104 104 "\\frac{1}{\\Bigl(\\sqrt{\\phi \\sqrt{5}}-\\phi\\Bigr) e^{\\frac25 \\pi}} =\n",
105 105 "1+\\frac{e^{-2\\pi}} {1+\\frac{e^{-4\\pi}} {1+\\frac{e^{-6\\pi}}\n",
106 106 "{1+\\frac{e^{-8\\pi}} {1+\\ldots} } } } \n",
107 107 "\\end{equation*}\n",
108 108 "```\n",
109 109 "### Display\n",
110 110 "\\begin{equation*}\n",
111 111 "\\frac{1}{\\Bigl(\\sqrt{\\phi \\sqrt{5}}-\\phi\\Bigr) e^{\\frac25 \\pi}} =\n",
112 112 "1+\\frac{e^{-2\\pi}} {1+\\frac{e^{-4\\pi}} {1+\\frac{e^{-6\\pi}}\n",
113 113 "{1+\\frac{e^{-8\\pi}} {1+\\ldots} } } } \n",
114 114 "\\end{equation*}"
115 115 ]
116 116 },
117 117 {
118 118 "cell_type": "markdown",
119 119 "metadata": {},
120 120 "source": [
121 121 "## A Rogers-Ramanujan Identity\n",
122 122 "### Source\n",
123 123 "```\\begin{equation*}\n",
124 124 "1 + \\frac{q^2}{(1-q)}+\\frac{q^6}{(1-q)(1-q^2)}+\\cdots =\n",
125 125 "\\prod_{j=0}^{\\infty}\\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},\n",
126 126 "\\quad\\quad \\text{for $|q|<1$}. \n",
127 127 "\\end{equation*}\n",
128 128 "```\n",
129 129 "### Display\n",
130 130 "\\begin{equation*}\n",
131 131 "1 + \\frac{q^2}{(1-q)}+\\frac{q^6}{(1-q)(1-q^2)}+\\cdots =\n",
132 132 "\\prod_{j=0}^{\\infty}\\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},\n",
133 133 "\\quad\\quad \\text{for $|q|<1$}. \n",
134 134 "\\end{equation*}"
135 135 ]
136 136 },
137 137 {
138 138 "cell_type": "markdown",
139 139 "metadata": {},
140 140 "source": [
141 141 "## Maxwell's Equations\n",
142 142 "### Source\n",
143 143 "```\\begin{align}\n",
144 144 "\\nabla \\times \\vec{\\mathbf{B}} -\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{E}}}{\\partial t} & = \\frac{4\\pi}{c}\\vec{\\mathbf{j}} \\\\ \\nabla \\cdot \\vec{\\mathbf{E}} & = 4 \\pi \\rho \\\\\n",
145 145 "\\nabla \\times \\vec{\\mathbf{E}}\\, +\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{B}}}{\\partial t} & = \\vec{\\mathbf{0}} \\\\\n",
146 146 "\\nabla \\cdot \\vec{\\mathbf{B}} & = 0 \n",
147 147 "\\end{align}\n",
148 148 "```\n",
149 149 "### Display\n",
150 150 "\\begin{align}\n",
151 151 "\\nabla \\times \\vec{\\mathbf{B}} -\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{E}}}{\\partial t} & = \\frac{4\\pi}{c}\\vec{\\mathbf{j}} \\\\ \\nabla \\cdot \\vec{\\mathbf{E}} & = 4 \\pi \\rho \\\\\n",
152 152 "\\nabla \\times \\vec{\\mathbf{E}}\\, +\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{B}}}{\\partial t} & = \\vec{\\mathbf{0}} \\\\\n",
153 153 "\\nabla \\cdot \\vec{\\mathbf{B}} & = 0 \n",
154 154 "\\end{align}"
155 155 ]
156 156 },
157 157 {
158 158 "cell_type": "markdown",
159 159 "metadata": {},
160 160 "source": [
161 161 "# Equation Numbering and References\n",
162 162 "\n",
163 163 "---\n",
164 164 "\n",
165 165 "Equation numbering and referencing will be available in a future version of IPython."
166 166 ]
167 167 },
168 168 {
169 169 "cell_type": "markdown",
170 170 "metadata": {},
171 171 "source": [
172 172 "# Inline Typesetting (Mixing Markdown and TeX)\n",
173 173 "\n",
174 174 "---\n",
175 175 "\n",
176 176 "While display equations look good for a page of samples, the ability to mix math and *formatted* **text** in a paragraph is also important.\n",
177 177 "\n",
178 178 "## Source\n",
179 179 "``` This expression $\\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a **[Markdown-formatted](http://daringfireball.net/projects/markdown/)** sentence. \n",
180 180 "```\n",
181 181 "## Display\n",
182 182 "This expression $\\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a **[Markdown-formatted](http://daringfireball.net/projects/markdown/)** sentence. "
183 183 ]
184 184 },
185 185 {
186 186 "cell_type": "markdown",
187 187 "metadata": {},
188 188 "source": [
189 189 "# Other Syntax\n",
190 190 "\n",
191 191 "---\n",
192 192 "\n",
193 193 "You will notice in other places on the web that `$$` are needed explicitly to begin and end MathJax typesetting. This is **not** required if you will be using TeX environments, but the IPython notebook will accept this syntax on legacy notebooks. \n",
194 194 "\n",
195 195 "### Source\n",
196 "```$$\n",
196 "```\n",
197 "$$\n",
197 198 "\\begin{array}{c}\n",
198 199 "y_1 \\\\\\\n",
199 200 "y_2 \\mathtt{t}_i \\\\\\\n",
200 201 "z_{3,4}\n",
201 202 "\\end{array}\n",
202 203 "$$\n",
203 204 "```\n",
204 205 "\n",
205 206 "```\n",
206 207 "$$\n",
207 208 "\\begin{array}{c}\n",
208 209 "y_1 \\cr\n",
209 210 "y_2 \\mathtt{t}_i \\cr\n",
210 211 "y_{3}\n",
211 212 "\\end{array}\n",
212 213 "$$\n",
213 214 "```\n",
214 215 "\n",
215 216 "```\n",
216 217 "$$\\begin{eqnarray} \n",
217 218 "x' &=& &x \\sin\\phi &+& z \\cos\\phi \\\\\n",
218 219 "z' &=& - &x \\cos\\phi &+& z \\sin\\phi \\\\\n",
219 220 "\\end{eqnarray}$$\n",
220 221 "```\n",
221 222 "\n",
222 223 "```\n",
223 224 "$$\n",
224 225 "x=4\n",
225 226 "$$\n",
226 227 "```\n",
227 228 "\n",
228 229 "### Display\n",
229 230 "$$\n",
230 231 "\\begin{array}{c}\n",
231 232 "y_1 \\\\\\\n",
232 233 "y_2 \\mathtt{t}_i \\\\\\\n",
233 234 "z_{3,4}\n",
234 235 "\\end{array}\n",
235 236 "$$\n",
236 237 "\n",
237 238 "$$\n",
238 239 "\\begin{array}{c}\n",
239 240 "y_1 \\cr\n",
240 241 "y_2 \\mathtt{t}_i \\cr\n",
241 242 "y_{3}\n",
242 243 "\\end{array}\n",
243 244 "$$\n",
244 245 "\n",
245 246 "$$\\begin{eqnarray} \n",
246 247 "x' &=& &x \\sin\\phi &+& z \\cos\\phi \\\\\n",
247 248 "z' &=& - &x \\cos\\phi &+& z \\sin\\phi \\\\\n",
248 249 "\\end{eqnarray}$$\n",
249 250 "\n",
250 251 "$$\n",
251 252 "x=4\n",
252 253 "$$"
253 254 ]
254 255 }
255 256 ],
256 257 "metadata": {}
257 258 }
258 259 ]
259 260 } No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now