DOC: added tutorial for using MathJax with Hugo - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit 2fa3761ec993657330d5b9ddbaaab1f58797fb61
DIR parent c02a02070f85e3a8fa14f2c6947ac2e5932b8c72
HTML Author: Spencer Lyon <spencerlyon2@gmail.com>
Date: Fri, 21 Mar 2014 17:14:40 -0400
DOC: added tutorial for using MathJax with Hugo
Diffstat:
A docs/content/tutorials/mathjax.md | 85 +++++++++++++++++++++++++++++++
1 file changed, 85 insertions(+), 0 deletions(-)
---
DIR diff --git a/docs/content/tutorials/mathjax.md b/docs/content/tutorials/mathjax.md
@@ -0,0 +1,85 @@
+---
+title: "MathJax Support"
+date: "2014-03-20"
+groups: ["tutorials"]
+groups_weight: 10
+author: "Spencer Lyon"
+---
+
+## What is MathJax?
+
+[MathJax](http://www.mathjax.org/) is a JavaScript library that allows allows the display of mathematical expressions described via a LaTeX-style syntax in the html (or markdown) source of a web page. As it is a pure a JavaScript library, getting it to work within Hugo is fairly straightforward, but does have some oddities that will be discussed here.
+
+This is not an introduction into actually using MathJax to render typeset mathematics on your website. Instead this page is a collection of tips and hints for one way to get MathJax working on a website built with Hugo.
+
+## Enabling MathJax
+
+The first step is to enable MathJax on pages that you would like to have typeset math. There are multiple ways to do this (adventerous readers can consult the [Loading and Configuring](http://docs.mathjax.org/en/latest/configuration.html) section of the MathJax documentation for additional methods of including MathJax), but the easiest way is to use the secure MathJax CDN by including the following html snippet in the source of a page:
+
+{{% highlight html %}}
+<script type="text/javascript"
+ src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
+</script>
+{{% /highlight %}}
+
+One way to ensure that this code is included in all pages is to put it in one of the templates that live in the `layouts/chrome/` directory. For example, I have included this in the bottom of my template `footer.html` because I know that the footer will be included in every page of my website.
+
+### Options and Features
+
+MathJax is a stable open-source library with many features. I encourage the interested reader to view the [MathJax Documentation](http://docs.mathjax.org/en/latest/index.html), specifically the sections on [Basic Usage](http://docs.mathjax.org/en/latest/index.html#basic-usage) and [MathJax Configuration Options](http://docs.mathjax.org/en/latest/index.html#mathjax-configuration-options).
+
+## Issues with Markdown
+
+After enabling MathJax, any math entered in-between proper markers (see documentation) will be processed and typeset in the web page. One issue that comes up, however, with markdown is that the underscore character (`_`) is interpreted by markdown as a way to wrap text in `emph` blocks while LaTex (MathJax) interprets the underscore as a way to create a subscript. This "double speak" of the underscore can result in some unexpected and unwanted behavior.
+
+### Solution
+
+There are multiple ways to remedy this problem. One solution is to simply escape each underscore in your math code by entering `\_` instead of `_`. This can become quite tedious if the equations you are entering are full of subscripts.
+
drkhsh.at:70 /scm/hugo/commit/2fa3761ec993657330d5b9ddbaaab1f58797fb61.gph:62: line too long