Skip to content

Commit c85f4dc

Browse files
author
_
committed
Add MathJax tests.
1 parent dec0e24 commit c85f4dc

File tree

3 files changed

+52
-2
lines changed

3 files changed

+52
-2
lines changed

test_book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- [Tables](individual/table.md)
2323
- [Tasks](individual/task.md)
2424
- [Strikethrough](individual/strikethrough.md)
25+
- [MathJax](individual/mathjax.md)
2526
- [Mixed](individual/mixed.md)
2627
- [Languages](languages/README.md)
2728
- [Syntax Highlight](languages/highlight.md)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# MathJax
2+
3+
Fourier Transform
4+
5+
\\[
6+
\begin{aligned}
7+
f(x) &= \int_{-\infty}^{\infty}F(s)(-1)^{ 2xs}ds \\\\
8+
F(s) &= \int_{-\infty}^{\infty}f(x)(-1)^{-2xs}dx
9+
\end{aligned}
10+
\\]
11+
12+
The kernel can also be written as \\(e^{2i\pi xs}\\) which is more frequently used in literature.
13+
14+
> Proof that \\(e^{ix} = \cos x + i\sin x\\) a.k.a Euler's Formula:
15+
>
16+
> \\(
17+
\begin{aligned}
18+
e^x &= \sum_{n=0}^\infty \frac{x^n}{n!} \implies e^{ix} = \sum_{n=0}^\infty \frac{(ix)^n}{n!} \\\\
19+
\cos x &= \sum_{m=0}^\infty \frac{(-1)^m x^{2m}}{(2m)!} = \sum_{m=0}^\infty \frac{(ix)^{2m}}{(2m)!} \\\\
20+
\sin x &= \sum_{s=0}^\infty \frac{(-1)^s x^{2s+1}}{(2s+1)!} = \sum_{s=0}^\infty \frac{(ix)^{2s+1}}{i(2s+1)!} \\\\
21+
\cos x + i\sin x &= \sum_{l=0}^\infty \frac{(ix)^{2l}}{(2l)!} + \sum_{s=0}^\infty \frac{(ix)^{2s+1}}{(2s+1)!} = \sum_{n=0}^\infty \frac{(ix)^{n}}{n!} \\\\
22+
&= e^{ix}
23+
\end{aligned}
24+
\\)
25+
>
26+
27+
28+
Pauli Matrices
29+
30+
\\[
31+
\begin{aligned}
32+
\sigma_x &= \begin{pmatrix}
33+
1 & 0 \\\\ 0 & 1
34+
\end{pmatrix} \\\\
35+
\sigma_y &= \begin{pmatrix}
36+
0 & -i \\\\ i & 0
37+
\end{pmatrix} \\\\
38+
\sigma_z &= \begin{pmatrix}
39+
1 & 0 \\\\ 0 & -1
40+
\end{pmatrix}
41+
\end{aligned}
42+
\\]

test_book/src/individual/mixed.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,16 @@ fn main(){
2929

3030
<kbd>Ctrl</kbd> + <kbd>S</kbd> saves a file.
3131

32-
A random image sprinkled in between
32+
---
33+
34+
Although markdown does not have a native figure caption syntax, one can use block quote as a general-purpose "environment" to emulate it, and max-level heading inside the quote as caption:
35+
36+
> ![](https://rust-lang.org/logos/rust-logo-256x256-blk.png)
37+
> ###### Figure 1: Our belived logo in glorious 256x256 resolution
38+
39+
Since the heading is inside the block quote, it will not pollute the document heading structure.
3340

34-
![16x16 rust-lang logo](https://rust-lang.org/logos/rust-logo-16x16.png)
41+
This is a lot more concise to write (and easier to read in plaintext!!) than the html `<figure>` environment, where the need for separate `<img/>` and `<figcaption>` tags adds significant visual noise.
3542

3643
---
3744

0 commit comments

Comments
 (0)