Closed mwpriddy closed 10 years ago
Working on this
I added MathJax to the Jekyll boilerplate so you can write Latex equations.
MathJax adds some overlays and annoying load times. I am assuming that Latex will be used less frequently than plain text. You need to active MathJax in individual posts.
In the YAML Front Matter of a post containing Latex, used the following key.
---
layout: post
latex: true
---
When latex: true
is assigned:
post.html
layout calls an include latex.html
@PaymanSh Can you make add this where it needs to be?
Placing information in YAML front matter makes it much easier to use later on. Placing an equation in the middle of a webpage will provide the necessary presentation layer. However, this information is harder to scrape and use later on. The following outlines a best practice for reusing equations.
Please see this example.
In this YAML front matter of a post use the following statements to create a post, equation, and activiate mathjax
---
layout: post # Use post layout
latex: true # Activate MathJax
eq1: | # Block String referenced in HTML
$$ \mathbf{L}_0^\mathrm{p} =
\sum_{\alpha=1}^{\mathrm{N}}\dot{\gamma}^{(\alpha)}
\left(\mathbf{s}_0^{(\alpha)} \otimes \mathbf{n}_0^{(\alpha)}\right) =
\dot{\mathbf{F}}^{\mathrm{p}} \cdot \left({\mathbf{F}^{\mathrm{p}}}\right)^{-1} $$
---
StackOverflow: String Literals and Multiline Strings in YAML
An equation can then be referenced in the post body using Liquid syntax.
The following equation explains how Jello emits X-rays:
{{page.eq1}}
Looks great! Thanks for the example links and stuff. I will definitely start placing equations in the YAML front matter now.
Getting the LaTeX equations up-and-running for us. Thanks :)