Update July 2018:
This post is outdated as the issues stated at the time of writing are not issues anymore. It is still kept for potential interest.
When adapting TeXt theme, LaTex support is essential.
-
The first thing is about setting up both ruby and node.js environment on my Ubuntu machine. Installing Ruby and gem went smoothly, therefore setting up Jekyll is easy. But when I tried to install
Node.js
andnpm
, my Ubuntu constantly complained that it could not install the current stable version of Node.js, and it installedNode 4.2.6
instead, which in turn made the latestnpm
refuse to work with the oldNode 4.2.6
. Many people filed this problem already, but most of them did not work for me.The problem is caused by a discontinued ppa application, I need to remove it from
/etc/apt/source.list
and/etc/apt/source.list.d
. This is the detailed solution -
The second thing is to make LaTex work in Markdown. MathJax is the choice but there exists several ways to set up MathJax in Jekyll, and some of them just did not work for me. I did not have the time to dig out the reason but just wanted to find a quick solution. Eventually I made it work with these settings:
- Using kramdown engine for markdown.
- Putting
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
in TeXt theme’s_layouts/page.html
. Be sure to usehttps
, otherwise the rendering online could fail. - Then I could write equations in LaTex! For inline equations, the expressions need to be embraced with double dollar sign like this:
$$x$$
. For independent lines, the expressions should start from a new line after$$
, and the ending$$
should also stay in a new line.
Okay, that is it. I hope someone could find this post useful.