Dave Doty
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
[Markdown](https://hackmd.io/c/codimd-documentation/%2F%40codimd%2Fmarkdown-syntax) is so-called *markup language*, along with [HTML](https://www.w3schools.com/html/) and [$\LaTeX$](https://www.latex-project.org/), meaning that it is a syntax for marking up text documents (making words bold, making large headers, etc.). However, it is much easier to read than HTML or pure Latex, although it allows embedded Latex for using mathematical notation. Here's a DFA $D$ ```mermaid graph LR _ --> a a((a)) --0--> b a --1--> c b --0--> c b --1--> b c((c)) --0--> c c --1--> b ``` The above is not standard Markdown, but uses a library called [mermaid](https://mermaid-js.github.io/mermaid/#/) for drawing graphs. Note that [Gradescope](https://www.gradescope.com/) does not support mermaid, but it does permit Latex in free-response answers for online assignments, so everything on this page except the above drawing should also work on Gradescope. Gradescope will also support Markdown in the future, but this is currently [on hold](https://trello.com/c/J4huJs47/267-latex-support-for-online-assignment-responses#comment-5e7b538279c3d303fd77265f). The formal definition of the DFA above is $D=(Q,\Sigma,\delta,s,F)$, where - $Q = \{a,b,c\}$ - $\Sigma = \{0,1\}$ - $s = a$ - $F = \{b\}$ - $\delta$ is defined as | |0|1| |-|-|-| |a|b|c| |b|c|b| |c|c|b| hackmd supports copying and pasting images directly into the browser; here's an image pasted from my lecture notes: ![](https://i.imgur.com/ZhEMk20.png) source code: ```python def square(n: int) -> int: return n*n ``` If you prefer editing offline, Visual Studio Code supports Markdown, with extensions for [Latex](https://marketplace.visualstudio.com/items?itemName=goessner.mdmath), [mermaid](https://marketplace.visualstudio.com/items?itemName=bierner.markdown-mermaid), and [pasting images](https://marketplace.visualstudio.com/items?itemName=telesoho.vscode-markdown-paste-image). ## More examples of $\LaTeX$ You can put math in the same line as the text like this: $x=5.$ Or you can put it on its own line like this: $$x=5.$$ Multiline equations are also useful: \begin{eqnarray*} x & = & y+z \\ & \leq & 2y \\ & < & 3y \qquad \text{if $y > 0$} \end{eqnarray*} Here's a list of common useful math symbols: - $x^2$, $y_2$. Use curly braces to group multiple characters, so you get $x^{100}$ instead of $x^100$. - $n_2$, $x_{n^2}$, $x_n^2$, $O(n \log n)$, $\hat{x}$, $\widehat{x}$, $\overline{A}$, $x_1'$, $x_n''$ - Plain text in math mode: $\{ p \in \mathbb{N} \mid p \text{ is prime} \}$ ($Please Please Please Do Not Just Type Words In Math Mode$ without the ``\text{}`` command, or it looks ugly and unreadable.) - Spaces in math mode: $\{ \ p \in \mathbb{N} \mid p \text{ is prime} \ \}$ - $\frac{\pi^2}{6} = \sum_{n=1}^{\infty} \frac{1}{n^2}$ - $\zeta(z) = \prod\limits_{n=1}^{\infty} \frac{1}{1 - p_n^{-z}}$ - $\mathbb{N} = \{ 0, 1, 2, \ldots \} = \mathbb{Z} \setminus \{-1, -2, \ldots \} \subseteq \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R} \not\subseteq \mathbb{R}^+$ - Greek letters: $\alpha, \beta, \gamma, \Gamma, \delta, \Delta, \epsilon, \zeta, \eta, \theta, \Theta, \kappa, \lambda, \Lambda, \mu, \nu, \xi, \Xi, \pi, \Pi, \rho, \sigma, \tau, \phi, \Phi, \chi, \psi, \Psi, \omega, \Omega$ - complexity classes: $\mathsf{P}, \mathsf{NP}, \mathsf{EXP}, \mathsf{DTIME}(n^3)$ - $\Sigma^*,a^*$ - $\delta: Q \times \Sigma \to Q$ - $(\forall X)\ |\mathcal{P}(X)| > |X|$ - $\lim_{n \to \infty} \frac{1}{n} = 0$, $\lim\limits_{n \to \infty} \frac{1}{n} = 0$ - $(\forall n \in \mathbb{N})(\exists m \in X)\ m > n \iff |X|=\infty \implies |X| \geq |\mathbb{N}|$ - $A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$ - $\Sigma^* = \bigcup_{i=0}^{\infty} \Sigma^i$ - regex's: $010^* \cup 1^∗ (01^+ \cup 10)^∗$ and $00(0|1)^*$ - CFG's: $A \to 0A1 \ | \ \varepsilon$ $A \to BB$ $B \to 1B0 \ | \ 0B \ | \ \varepsilon$ Note how ugly this looks: $$ ( \frac{1}{n^2} ) $$ Use `\left` and `\right` to make pairs of matching delimiters, like parentheses, big enough for the text they contain: $$ \left( \frac{1}{n^2} \right) $$ For defining sets where you want the vertical line in the middle to scale with the text size, it is useful to have a "phantom delimiter" (represented by a period paired with the `\left` or `\right`): $$ X = \left\{ \left. \frac{n^2}{2^{n^3}} \right| n \in \mathbb{N} \right\} $$ Of course this only works if you guess properly whether the left or right is bigger, which failed here: $$ X = \left\{ \left. n \right| \frac{n^2}{2^{n^3}} \geq \frac{1}{10} \right\} $$ For an example of a full Latex document (this page is snippets of Latex embedded in Markdown), see [sample.tex](https://web.cs.ucdavis.edu/~doty/fall2015ecs120/sample.tex) at my [Latex help page](https://web.cs.ucdavis.edu/~doty/fall2015ecs120/latex.html). # Gradescope Markdown/Latex Gradescope supports Latex in your responses to questions (and may support Markdown eventually), but with slight different syntax than is used on this page. The main difference is that you use a double-dollar-sign for inline equations, e.g., $$x = 2y$$, and you use a triple-dollar-sign for equations on their own line, e.g., $$$x = 2y.$$$ What appears below is the same content as the text above, and it won't look good on hackmd.io, but it will render properly on Gradescope. $$1^{2p+k}0^p$$ **Note:** Gradescope has [temporarily disabled](https://trello.com/c/J4huJs47/267-latex-support-for-online-assignment-responses#comment-5e7b538279c3d303fd77265f) rendering of Markdown. So the non-Latex parts below will appear un-rendered in plain text, as they do on the left side of the screen. ## Markdown and simple $$\LaTeX$$ [Markdown](https://hackmd.io/c/codimd-documentation/%2F%40codimd%2Fmarkdown-syntax) is so-called *markup language*, along with [HTML](https://www.w3schools.com/html/) and [$$\LaTeX$$](https://www.latex-project.org/), meaning that it is a syntax for marking up text documents (making words bold, making large headers, etc.). However, it is much easier to read than HTML or pure Latex, although it allows embedded Latex for using mathematical notation. Here's a DFA $$D$$ ```mermaid graph LR _--> a a((a)) --0--> b a --1--> c b --0--> c b --1--> b c((c)) --0--> c c --1--> b ``` The above is not standard Markdown, but uses a library called [mermaid](https://mermaid-js.github.io/mermaid/#/) for drawing graphs. [Gradescope](https://www.gradescope.com/) does not support mermaid, but it does support Latex in free-response answers for online assignments, so everything on this page except the above drawing should also work on Gradescope. Gradescope will also support Markdown in the future, but this is currently [on hold](https://trello.com/c/J4huJs47/267-latex-support-for-online-assignment-responses#comment-5e7b538279c3d303fd77265f). The formal definition of the DFA is $$D=(Q,\Sigma,\delta,s,F)$$, where - $$Q = \{a,b,c\}$$ - $$\Sigma = \{0,1\}$$ - $$s = a$$ - $$F = \{a,c\}$$ - $$\delta$$ is defined as (note that unlike hackmd, there are no leading spaces in the table below) | |0|1| |-|-|-| |a|b|c| |b|c|b| |c|c|a| hackmd supports copying and pasting images directly into the browser (note that Gradescope allows one to upload images, but it is not as straightforward to simply paste them via Ctrl/Cmd+V, but since pasting into hackmd.io created this URL for the image, the same link can be used on Gradescope); here's an image pasted from my lecture notes: ![](https://i.imgur.com/ZhEMk20.png) source code: ```python def square(n): return n*n ``` If you prefer editing offline, Visual Studio Code supports Markdown, with extensions for Latex (https://marketplace.visualstudio.com/items?itemName=goessner.mdmath), mermaid (https://marketplace.visualstudio.com/items?itemName=bierner.markdown-mermaid), and pasting images (https://marketplace.visualstudio.com/items?itemName=telesoho.vscode-markdown-paste-image). More examples of $$\LaTeX$$ === You can put math in the same line as the text like this: $$x=5.$$ Or you can put it on its own line like this: $$$x=5.$$$ Multiline equations don't work in Gradescope. Here's a list of common useful math symbols: * $$x^2, y_2$$. Use curly braces to group multiple characters, so you get $$x^{100}$$ instead of $$x^100$$. - $$n_2, x_{n^2}, x_n^2, O(n \log n), \hat{x}, \overline{A}, x_1', x_n''$$ - Plain text in math mode: $$\{ p \in \mathbb{N} \mid p \text{ is prime} \}$$ - Spaces in math mode: $$\{ \ p \in \mathbb{N} \mid p \text{ is prime} \ \}$$ - $$\frac{\pi^2}{6} = \sum_{n=1}^{\infty} \frac{1}{n^2}$$ - $$\zeta(z) = \prod\limits_{n=1}^{\infty} \frac{1}{1 - p_n^{-z}}$$ - $$\mathbb{N} = \{ 0, 1, 2, \ldots \} = \mathbb{Z} \setminus \{-1, -2, \ldots \} \subseteq \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R} \not\subseteq \mathbb{R}^+$$ - Greek letters: $$\alpha, \beta, \gamma, \Gamma, \delta, \Delta, \epsilon, \zeta, \eta, \theta, \Theta, \kappa, \lambda, \Lambda, \mu, \nu, \xi, \Xi, \pi, \Pi, \rho, \sigma, \tau, \phi, \Phi, \chi, \psi, \Psi, \omega, \Omega$$ - complexity classes: $$\mathsf{P}, \mathsf{NP}, \mathsf{DTIME}(n^3)$$ - $$\Sigma^*, \{0,1\}^*$$ - $$\delta: Q \times \Sigma \to Q$$ - $$(\forall X)\ |\mathcal{P}(X)| > |X|$$ - $$\lim_{n \to \infty} \frac{1}{n} = 0$$ - $$(\forall n \in \mathbb{N})(\exists m \in X)\ m > n \iff |X|=\infty \implies |X| \geq |\mathbb{N}|$$ - $$A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$$ - $$\Sigma^* = \bigcup_{i=0}^{\infty} \Sigma^i$$ - regex's: $$010^* \cup 1^* (01^+ \cup 10)^*$$, $$010^* \cup 1^* (01^+ \cup 10)^*$$ - CFG's: $$A \to 0A1 | \varepsilon$$ $$A \to BB$$ $$B \to 1B0 | 0B | \varepsilon$$ Note how ugly this looks: $$$ ( \frac{1}{n^2} ) $$$ Use `\left` and `\right` to make pairs of matching delimiters big enough for the text they contain: $$$ \left( \frac{1}{n^2} \right) $$$ For defining sets where you want the vertical line in the middle to scale with the text size, it is useful to have a "phantom delimiter" (represented by a period): $$$ X = \left\{ \left. \frac{n^2}{2^{n^3}} \right| n \in \mathbb{N} \right\} $$$ Of course this only works if you guess properly whether the left or right is bigger, which failed here: $$$ X = \left\{ \left. n \right| \frac{n^2}{2^{n^3}} \geq \frac{1}{10} \right\} $$$ For an example of a full Latex document (this page is snippets of Latex embedded in Markdown), see [sample.tex](https://web.cs.ucdavis.edu/~doty/fall2015ecs120/sample.tex) at my [Latex help page](https://web.cs.ucdavis.edu/~doty/fall2015ecs120/latex.html).

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully