Markdown Cheat Sheet
Date Written: 24-06-2023

Markdown

Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

Documentation: Markdown Docs RFC: RFC 7763 GitHub Documentation: Writing Markdown on GitHub


Headings


# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6

Here is a heading: # Heading, don’t do this: #Heading

Emphasis


StyleSyntaxExampleOutput
Bold** ** or __ __**Bold text**Bold text
Italic* * or _ _*Italic text*Italic text
Strikethrough~~ ~~~~Striked out text~~Striked out text
Highlight== ====Highlighted text====Highlighted text==
Bold and nested italic** ** and _ _**Bold text and _nested italic_ text**Bold text and nested italic text
Bold and italic*** *** or ___ ___***Bold and italic text***Bold and italic text

Line Breaks


First line with two spaces after.  
And the next line.

Lists


Ordered Lists

1. First item
2. Second item
3. Third item

Unordered Lists

- First item
- Second item
- Third item

Link with text: [link-text](https://www.google.com)
Wikilink: `[[Three laws of motion]]`
Markdown: `[Three laws of motion](Three%20laws%20of%20motion.md)`

Embed a note in another note


To embed a note:

![[Internal links]]

You can also embed links to headings and blocks.

![[Internal links#^b15695]]

The text below is an example of an embedded block:

Learn how to link to notes, attachments, and other files from your notes, using internal links. By linking notes, you can create a network of knowledge.

Images


Image with alt text: ![alt-text](https://camo.githubusercontent.com/4d89cd791580bfb19080f8b0844ba7e1235aa4becc3f43dfd708a769e257d8de/68747470733a2f2f636e642d70726f642d312e73332e75732d776573742d3030342e6261636b626c617a6562322e636f6d2f6e65772d62616e6e6572342d7363616c65642d666f722d6769746875622e6a7067)

Image without alt text: ![](https://camo.githubusercontent.com/4d89cd791580bfb19080f8b0844ba7e1235aa4becc3f43dfd708a769e257d8de/68747470733a2f2f636e642d70726f642d312e73332e75732d776573742d3030342e6261636b626c617a6562322e636f6d2f6e65772d62616e6e6572342d7363616c65642d666f722d6769746875622e6a7067)

Code Blocks


Inline Code Block

Inline `code` has `back-ticks around` it.

Blocks of Code

var s = "JavaScript syntax highlighting";
alert(s);
s = "Python syntax highlighting"
print s
No language indicated, so no syntax highlighting. 
But let's throw in a <b>tag</b>.

Tables


There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don’t need to make the raw Markdown line up prettily.

| Heading 1 | Heading 2 | Heading 3 |
|---|---|---|
| col1 | col2 | col3 |
| col1 | col2 | col3 |

Task list


To create a task list start line with square brackets with an empty space. Ex: [ ] and add text for task. To check the task replace the space between the bracket with “x”.

[x] Write the post
[ ] Update the website
[ ] Contact the user

Quotes 


You can quote text by adding a > symbols before the text.

> Human beings face ever more complex and urgent problems, and their effectiveness in dealing with these problems is a matter that is critical to the stability and continued progress of society.

\- Doug Engelbart, 1961

Human beings face ever more complex and urgent problems, and their effectiveness in dealing with these problems is a matter that is critical to the stability and continued progress of society. - Doug Engelbart, 1961

Callouts


To create a callout add [!info] to the begining line of a blockquote

[!info] Here’s a callout block.
It supports MarkdownWikilinks and embeds!

Change the title

By default, the title of the callout is its type identifier in title case. You can change it by adding text after the type identifier:

> [!tip] Callouts can have custom titles
> Like this one.

[!tip] Callouts can have custom titles Like this one.

> [!faq]- Are callouts foldable? 
> Yes! In a foldable callout, the contents are hidden when the callout is collapsed.

[!faq]- Are callouts foldable? Yes! In a foldable callout, the contents are hidden when the callout is collapsed.

> [!question] Can callouts be nested?
> > [!todo] Yes!, they can.
> > > [!example]  You can even use multiple layers of nesting.

[!question] Can callouts be nested?

[!todo] Yes!, they can.

[!example] You can even use multiple layers of nesting.

Heres a list of a bunch of different callouts

[!example]- Lorem ipsum dolor sit amet

[!bug]- Lorem ipsum dolor sit amet

[!danger]- Lorem ipsum dolor sit amet

[!failure]- Lorem ipsum dolor sit amet

[!warning]- Lorem ipsum dolor sit amet

[!question]- Lorem ipsum dolor sit amet

[!success]- Lorem ipsum dolor sit amet

[!tip]- Lorem ipsum dolor sit amet

[!todo]- Lorem ipsum dolor sit amet

[!abstract]- Lorem ipsum dolor sit amet

Footnotes


You can add footnotes1  to your notes using the following syntax:

This is a simple footnote[^1].

[^1]: This is the referenced text.
[^2]: Add 2 spaces at the start of each new line.
  This lets you write footnotes that span multiple lines.
[^note]: Named footnotes still appear as numbers, but can make it easier to identify and link references.

Diagrams


You can add diagrams and charts to your notes, using Mermaid. Mermaid supports a range of diagrams, such as flow chartssequence diagrams, and timelines.

To add a Mermaid diagram, create a mermaid code block.

graph TD
    A[Enter Chart Definition] --> B(Preview)
    B --> C{decide}
    C --> D[Keep]
    C --> E[Edit Definition]
    E --> B
    D --> F[Save Image and Code]
    F --> B
sequenceDiagram
    Alice->>+John: Hello John, how are you?
    Alice->>+John: John, can you hear me?
    John-->>-Alice: Hi Alice, I can hear you!
    John-->>-Alice: I feel great!

MathJax


MathJax is a cross-browser JavaScript library that displays mathematical notation in web browsers. Read tutorial Jekyll - Math Symbols with MathJax to learn how to use MathJax in web page and Markdown.

MathJax Cheat Sheet

TitleFormulaMarkdown
Variables$x_1$, $y_1$, $z_{3,4}$$x_1$, $y_1$, $z_{3,4}$
Square$a^2$, $$x^y$, $2^{n-1}$$a^2$, $$x^y$, $2^{n-1}$
Square Root$\sqrt{9}$, $\sqrt{x}$, $\sqrt[n]{x}$$\sqrt{9}$, $\sqrt{x}$, $\sqrt[n]{x}$
Logarithm$\log{}x$, $\log_{2}x$$\log{}x$, $\log_{2}x$
Fraction$\frac{1}{2}$, $\left(-\frac{1}{2}\right)^n$$\frac{1}{2}$, $\left(-\frac{1}{2}\right)^n$
Infinity$\infty$
Absolute Value$\vert{x}\vert$, $\vert\frac{x}{2}\vert$, $\lfloor{x}\rfloor$, $\lceil{x}\rceil$$\vert{x}\vert$, $\vert\frac{x}{2}\vert$, $\lfloor{x}\rfloor$, $\lceil{x}\rceil$
Arithmetic Operation$2\times 3$, $6\div 3$$2\times 3$, $6\div 3$
Factorial$n!$$n!$
Trigonometric Functions$\sin\theta$, $$\cos\theta$, $\tan\theta$$\sin\theta$, $$\cos\theta$, $\tan\theta$
Greater or Less$a\gt b$, $a\geq b$, $a\lt b$, $a\leq b$$a\gt b$, $a\geq b$, $a\lt b$, $a\leq b$
Equation$a=b$, $a\neq b$, $a\approx b$$a=b$, $a\neq b$, $a\approx b$
Times Dot$a\cdot b=ab$$a\cdot b=ab$
Divide Fraction$a/b=\frac{a}{b}$$a/b=\frac{a}{b}$
Trinomial Equation$a^2 + b^2 = c^2$$a^2 + b^2 = c^2$
Matrix Parentheses$$\begin{pmatrix} a & b \ c & d \end{pmatrix}$$$$\begin{pmatrix} a & b \\ c & d \end{pmatrix}$$
Matrix Brackets$$\begin{bmatrix} a & b \ c & d \end{bmatrix}$$$$\begin{bmatrix} a & b \\ c & d \end{bmatrix}$$
Matrix Equation$$\begin{vmatrix} a & b \ c & d \end{vmatrix}=ad-bc$$$$\begin{vmatrix} a & b \\ c & d \end{vmatrix}=ad-bc$$
Set$x\in A$, $A\ni x$, $x\notin A$$x\in A$, $A\ni x$, $x\notin A$
Subset$A\subset B$, $A\subseteq B$, $A \not \subset B$$A\subset B$, $A\subseteq B$, $A \not \subset B$
Intersection & Union$A\cap B$, $A\cup B$, $\overline{A}$$A\cap B$, $A\cup B$, $\overline{A}$
Quadratic formula$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $
Binomial$\sqrt{3x-1}+(1+x)^2$$\sqrt{3x-1}+(1+x)^2$
Differentiation$f’$, $f^{(n)}$, $D_x f$$f'$, $f^{(n)}$, $D_x f$
Integral$\int_0^1 f(x) dx$$\int_0^1 f(x) dx$
Integral Large$\displaystyle \int_{-\infty }^{\infty}f(x)dx$$\displaystyle \int_{-\infty }^{\infty}f(x)dx$
Max Sample$$\max(a,b)=\begin{cases}a&(a\geqq b)\b&(a\lt b)\end{cases}$$$$\max(a,b)=\begin{cases}a&(a\geqq b)\\b&(a\lt b)\end{cases}$$
NameNotationMarkdown
Big O [micron]$\mathcal{O}$ or $O$$\mathcal{O}$ or $O$
Big Omega$\Omega$$\Omega$
Big Theta$\Theta$$\Theta$
Small O [micron]$o$$o$
Small Omega$\omega$$\omega$
On the order of$\sim$$\sim$

Common Time and Space Complexity

NameRunning TimeMarkdown
Constant Time$O(1)$$O(1)$
Logarithmic Time$O(\log{}n)$$O(\log{}n)$
Linear Time$O(n)$$O(n)$
Quasilinear Time$O(n\log{}n)$$O(n\log{}n)$
Quadratic Time$O(n^2)$$O(n^2)$
Cubic Time$O(n^3)$$O(n^3)$
Factorial Time$O(n!)$$O(n!)$

Scaled parentheses

SymbolCode
(…)\left( … \right)
[…]\left[ … \right]
{…}\left{ … \right}
|…|\left\vert … \right\vert
∥…∥\left\Vert … \right\Vert
⟨…⟩\left\langle … \right\rangle
⌈…⌉\left\lceil … \right\rceil
⌊…⌋\left\lfloor … \right\rfloor

Hidden parentheses

SymbolCode
{…\left{ … \right.
…]\left. … \right]

Logical symbols

SymbolCode
<\lt
>\gt
\le
\leq
\leqq
\leqslant
\ge
\geq
\geqq
\geqslant
\neq
\land
\lor
¬\lnot
\forall
\exists
\nexists
\top
\bot
\vdash
\vDash
\approx
\sim
\simeq
\cong
\equiv
\prec
\lhd
\therefore

Operators

SymbolCode
×\times
÷\div
±\pm
\mp
\cdot
\star
\ast
\oplus
\circ
\bullet

Set symbols

SymbolCode
\cup
\cap
\setminus
\subset
\subseteq
\subsetneq
\supset
\in
\notin
\emptyset
\varnothing

Arrows

SymbolCode
\to
\rightarrow
\leftarrow
\Rightarrow
\Leftarrow
\Leftrightarrow
\mapsto

Special symbols

SymbolCode
\infty
\nabla
\partial
\Im
\Re
……\ldots
⋯⋯\cdots
\ell

Trigonometry

SymbolCode
$\sin x$\sin x
$\cos x$\cos x
$\tan x$\tan x
$\cot x$\cot x
$\sec x$\sec x
$\csc x$\csc x
$\arcsin x$\arcsin x
$\arccos x$\arccos x
$\arctan x$\arctan x

Functional symbols

SymbolCode
$\sqrt{x^3}$\sqrt{x^3}
$\sqrt[3]{\frac xy}$\sqrt[3]{\frac xy}
$\ln(x)$\ln(x)
$\log_{2}(x)$\log_{2}(x)
$\sum_{n=1} ^{N} n$\sum_{n=1} ^{N} n
$\prod_{n=1} ^{N} n$\prod_{n=1} ^{N} n
$\int_{0} ^{\infty} x dx$\int_{0} ^{\infty} x dx
$\iint_{0} ^{\infty} x dx$\iint_{0} ^{\infty} x dx
$\iiint_{0} ^{\infty} x dx$\iiint_{0} ^{\infty} x dx
$\lim_{x \to \infty} {1 \over x }$\lim_{x \to \infty} {1 \over x }
$\max(1,2,3)$\max(1,2,3)
$\min(3,4,5)$\min(3,4,5)
${n+1 \choose 2k}${n+1 \choose 2k}
$\binom{n+1}{2k} (n+12k)$\binom{n+1}{2k} (n+12k)

Greek letters


Lowercase

SymbolCode
$\alpha$\alpha
$\beta$\beta
$\gamma$\gamma
$\delta$\delta
$\epsilon$\epsilon
$\varepsilon$\varepsilon
$\zeta$\zeta
$\eta$\eta
$\theta$\theta
$\vartheta$\vartheta
$\iota$\iota
$\kappa$\kappa
$\lambda$\lambda
μ\mu
ν\nu
ξ\xi
ο\omicron
π\pi
ϖ\varpi
ρ\rho
ϱ\varrho
σ\sigma
ς\varsigma
τ\tau
υ\upsilon
ϕ\phi
φ\varphi
χ\chi
ψ\psi
ω\omega

Uppercase

SymbolCode
$\Gamma$\Gamma
$\Delta$\Delta
$\Theta$\Theta
$\Lambda$\Lambda
$\Xi$\Xi
$\Pi$\Pi
$\Sigma$\Sigma
$\Upsilon$\Upsilon
$\Psi$\Psi
$\Omega$\Omega

Fonts


SymbolCode
$\mathbb{N}$\mathbb{N}
$\mathbb{Z}$\mathbb{Z}
$\mathbb{Q}$\mathbb{Q}
$\mathbb{I}$\mathbb{I}
$\mathbb{R}$\mathbb{R}
$\mathbb{C}$\mathbb{C}
$\text{ is an even number}$\text{ is an even number}
$\Bbb{blackboard bold}$\Bbb{blackboard bold}
$\mathbf{boldface}$\mathbf{boldface}
$\mathit{italics}$\mathit{italics}
$\pmb{boldfaced italics}$\pmb{boldfaced italics}
$\mathtt{ for typewriter}$\mathtt{ for typewriter}
$\mathrm{roman font}$\mathrm{roman font}
$\mathsf{sans-serif font}$\mathsf{sans-serif font}
$\mathcal{calligraphic letters}$\mathcal{calligraphic letters}
$\mathscr{script letters}$\mathscr{script letters}
$\mathfrak{Fraktur (old German style) letters}$\mathfrak{Fraktur (old German style) letters}

Spaces

SymbolCode
$Thin \ space$Thin \ space
$Normal ; space$Normal ; space
$Big \quad space$Big \quad space
$Bigger \qquad space$Bigger \qquad space

Accents and marks


SymbolCode
$\hat{x}$\hat{x}
$\overline{xyz}$\overline{xyz}
$\vec{x}$\vec{x}
$\widehat{xy}$\widehat{xy}
$\bar{x}$\bar{x}
$\overrightarrow{xy}$\overrightarrow{xy}
$\overleftrightarrow{xy}$\overleftrightarrow{xy}
$\dot{x}$\dot{x}
$\ddot{x}$\ddot{x}

Footnotes

  1. This is the referenced text.