From charlesreid1

(Created page with "This is all following this site: http://www.idryman.org/blog/2012/03/10/writing-math-equations-on-octopress/ Now get to the deployment: <pre> cd ~/codes/charlesreid1.github.io/...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
This is all following this site: http://www.idryman.org/blog/2012/03/10/writing-math-equations-on-octopress/
This is all following this site: http://www.idryman.org/blog/2012/03/10/writing-math-equations-on-octopress/


Now get to the deployment:
=Installing/Configuring It=
 
Now get to the deployment. You'll be installing a gem called kramdown, which supports Latex maths stuff:


<pre>
<pre>
Line 8: Line 10:
</pre>
</pre>


Change _config.yml:
Replace all instances of <code>rdiscount</code> with <code>kramdown</code> in _config.yml:


<pre>
<pre>
Line 14: Line 16:
</pre>
</pre>


Change Gemfile:
Replace all instances of <code>rdiscount</code> with <code>kramdown</code> in Gemfile:


<pre>
<pre>
Line 63: Line 65:


and you're done.
and you're done.
=Using It=
To use it, just put latex between a pair of dollar signs in your markdown:
<pre>
$$
H \psi = E \psi
$$
</pre>
[[Category:Octopress]]
[[Category:Latex]]

Latest revision as of 06:19, 5 August 2014

This is all following this site: http://www.idryman.org/blog/2012/03/10/writing-math-equations-on-octopress/

Installing/Configuring It

Now get to the deployment. You'll be installing a gem called kramdown, which supports Latex maths stuff:

cd ~/codes/charlesreid1.github.io/
gem install kramdown

Replace all instances of rdiscount with kramdown in _config.yml:

s/rdiscount/kramdown/g

Replace all instances of rdiscount with kramdown in Gemfile:

s/rdiscount/kramdown/g

and change the version number to 0.13.8, or whatever version you installed.

Lastly, make MathJax available to all the site static content: edit source/_layouts/default.html and put this before the <body> tag

<!-- mathjax config similar to math.stackexchange -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  jax: ["input/TeX", "output/HTML-CSS"],
  tex2jax: {
    inlineMath: [ ['$', '$'] ],
    displayMath: [ ['$$', '$$']],
    processEscapes: true,
    skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
  },
  messageStyle: "none",
  "HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"] }
});
</script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript"></script>

Finally you can fix the right-click bug that the blog above mentions, which was mentioned on another blog.

Edit sass/base/_theme.scss

Change

body {
  > div {
    background: $sidebar-bg $noise-bg;

to

body {
  > div#main {
    background: $sidebar-bg $noise-bg;

and you're done.

Using It

To use it, just put latex between a pair of dollar signs in your markdown:

$$
H \psi = E \psi
$$