Living document with basic Jekyll templates.

Writing and formatting posts

Text Formatting

Jekyll supports basic formatting such as

  • italic
  • bold
  • Strikethrough

Jekyll doesn’t support

  1. Subscript: H~2~O
  2. Superscript: X^2^
  3. Emojis: :joy:

Math Formatting

Inline math is made with \\( \\) like this: \(\nabla_{W} \log p(y=UP \mid x) \frac{1}{2} \) its strange.

is not made wiht $, it

Fancy math is made with $$ and supports align environments like this: \(\begin{align} \nabla_{\theta} E_x[f(x)] &= \nabla_{\theta} \sum_x p(x) f(x) & \text{definition of expectation} \\ & = \sum_x \nabla_{\theta} p(x) f(x) & \text{swap sum and gradient} \\ & = \sum_x p(x) \frac{\nabla_{\theta} p(x)}{p(x)} f(x) & \text{both multiply and divide by } p(x) \\ & = \sum_x p(x) \nabla_{\theta} \log p(x) f(x) & \text{use the fact that } \nabla_{\theta} \log(z) = \frac{1}{z} \nabla_{\theta} z \\ & = E_x[f(x) \nabla_{\theta} \log p(x) ] & \text{definition of expectation} \end{align}\)

Images

Image caption. In here you use HTML, not mark down for formatting, e.g. to make bold, and hyperlinks are made like this
Two images can also be set side-by-side, but you might have to play with the height manually...

Embed Youtube videos

YouTube videos, like this one explaining Jekyll, can be embedded with a little HTML like this one:

You can embedd YouTube videos by copying the `iframe` from YouTube.com (-> Share -> Embed)

Comments

You can make comments in the markdown file that aren’t complied, and there are several options

  • [//]: # COMMENT should be the most portable comment. It must be on a separate line following a blank line.
  • <!-- COMMENT --> allows for multi-line and inline comments.

Footnotes

Footnotes are made with [^XXX] in the text and [^XXX]: on a separate line with the note. XXX can be any key that you want 1. This is a text with a footnote2, that also has a second footnote 3. Numbering the footnotes is automatic and incrementing. You can reffer to the same footnote more than once 2.

Horizontal lines are made with ---


Code Formating

This is inline code and this is a sample code block (supports syntax highlighting):

import numpy as np
def foo(x):
    # this is not code, this is a comment
    for i in range(x):
        print(i)
foo(5)

I like to put the output of code in a separate code block inside a block quote, like so:

0
1
2
3
4

You can also make codeblocks by indenting with 4 spaces, but then you don’t get syntax highlighing.

Lists

Bulleted lists

  • Top level
    • second
    • level
      • third
      • level
  • Top level

Numbered lists

  1. Item one
    1. sub item one
    2. sub item two
    3. sub item three
  2. Item two
    1. sub item one
    2. sub item two
    3. sub item three

Task lists

  • Write the press release
  • Update the website
  • Contact the media

Blockquotes

A sample blockquote.

Nested blockquotes are also possible.

Headers work too

This is the outer quote again.




  1. Like this. 

  2. here is the definition.  2

  3. And another definition.