Yifan Zhu PhD Student, Statistician

Math and Code Formatting

Lagrange comes out of the box with MathJax and syntax highlighting through fenced code blocks. MathJax allows you to display mathematical equations in your posts through the use of LaTeX. Syntax highlighting allows you to display source code in different colors and fonts depending on what programming language is being displayed.

As always, Jekyll offers support for GitHub Flavored Markdown, which allows you to format your posts using the Markdown syntax. Examples of these text formatting features can be seen below. You can find this post in the _posts directory.

MathJax

The Schrödinger equation is a partial differential equation that describes how the quantum state of a quantum system changes with time:

Joseph-Louis Lagrange was an Italian mathematician and astronomer who was responsible for the formulation of Lagrangian mechanics, which is a reformulation of Newtonian mechanics.

When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are

MathJax

Let’s test some inline math $x$, $y$, $x_1$, $y_1$.

Now a inline math with special character: $|\psi\rangle$, $x’$, $x^*$ and $|\psi_1\rangle = a|0\rangle + b|1\rangle$

Test a display math: Is it O.K.?

Test a display math with equation number: \begin{equation} |\psi_1\rangle = a|0\rangle + b|1\rangle \end{equation} Is it O.K.?

Test a display math with equation number:

Is it O.K.?

And test a display math without equaltion number: Is it O.K.?

Test a display math with equation number: Is it O.K.?

And test a display math without equaltion number:

Code Highlighting

You can find the full list of supported programming languages here.

#container {
  float: left;
  margin: 0 -240px 0 0;
  width: 100%;
}
def print_hi(name)
  puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.

Another option is to embed your code through Gist.