forked from RustPython/RustPython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython-markdown-math.txt
69 lines (42 loc) · 1.24 KB
/
python-markdown-math.txt
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
%%py
print("Javascript called. It wants its DOM elements back.")
%%md
## RustPython Notebook with Markdown and Math
Look! I can write markdown in the notebook. It's even syntax-highlighted correctly!
1. i can make a list
1. i can haz many lines and numbers
1. I can paste emojis 🐍 😱 🤘
In the notebook, you can write markdown, math and python. use %% then:
- md for markdown
- py for python
- math for large, centered math blocks
- math-inline for an inline math block
I **can** bold things and _italicize_ them. You got the gist, this is standard
markdown syntax that you can [google](https://google.com).
<br>
## Math
Supported TeX functions is [here](https://katex.org/docs/supported.html). For example:
%%math
\tau(u_f)*l_f
\newline
H(t) \xrightarrow{write} \Big[A(t+1),\ H(t+1)\Big]
\newline
\newline
% \f is defined as #1f(#2) using the macro
\f\relax{x} = \int_{-\infty}^\infty
\f\hat\xi,e^{2 \pi i \xi x}
\,d\xi
\newline
\begin{Bmatrix}
a & b \\
c & d
\end{Bmatrix}
\dbinom{n}{k}
\sqrt[3]{x}
%%py
print("RustPython called back and said people need to have")
# You can run regular python code here.
# Here is a random number generator.
import random
rnd = random.randint(1,5)
print("nice " * rnd + "things.")