fogus/marginalia — Issue #76: LaTeX does not appear to work
Author: acgetchell
Created: 2011-12-22 03:17:29+00:00
State: open

Here's the example given:

https://github.com/fogus/marginalia/blob/master/src/marginalia/html.clj#L124

Here is the project file for the Newton project:

(defproject Newton "1.0.0-SNAPSHOT"
:description "Causal Dynamical Triangulations in Clojure with Newtonian Approximation"
:url "https://github.com/ucdavis/CDT"
:dependencies [[org.clojure/clojure "1.3.0"]]
:test-selectors {:default (fn [v] (not (:utilities v)))
:utilities :utilities
:all (fn [_] true)}
:dev-dependencies [[lein-ring "0.4.5"] [lein-marginalia "0.6.1"]]
:marginalia {:javascript["mathjax/MathJax.js"]})

I have MathJax.js (42KB) installed in Newton/docs from the downloaded mathjax-MathJax-v1.1a-0-g1697387

Here are three example files from Newton/src/Newton:

core.clj:

(ns Newton.core)

simplex.clj:
(ns Newton.simplex)

;; # Load Optional Resources
;; Use external Javascript and CSS in your documentation. For example:
;; To format Latex math equations, download the
;; [MathJax](http://www.mathjax.org/) Javascript library to the docs
;; directory and then add
;;
;; :marginalia {:javascript ["mathjax/MathJax.js"]}
;;
;; to project.clj.
;;
;; When \\(a \ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\) and they are
;; $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

;; A simplex is a d-dimensional triangle. It has d+1 points and
;; $$\left(\begin{array}{c}d+1\\2\end{array}\right)$$ edges

utilities.clj:

(ns Newton.utilities)

;; To keep same name conventions as utilities.lisp
;; In idiomatic clojure, this could be replaced by the anonymous function
;; #(apply + %)
(defn sum
"sums the elements of a list"
[list]
(apply + list))

Doing lein marg produces (output elided):

When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

A simplex is a d-dimensional triangle. It has d+1 points and $$\left(\begin{array}{c}d+1\2\end{array}\right)$$ edges

Please feel free to verify.

Do I have something configured incorrectly?

Thanks!