LaTeX does not appear to work #76

Open
acgetchell opened this Issue Dec 22, 2011 · 4 comments

Comments

Projects
None yet
3 participants

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 %28:utilities v%29))
: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 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!

Collaborator

fogus commented Mar 6, 2012

Is this still an issue in Marginalia v0.7.0?

Yes.

C:\Projects\CDT\Newton>lein self-install
"C:\Users\getchell.lein\self-installs\leiningen-1.7.0-SNAPSHOT-standalone.jar"
already exists. Delete and retry.

C:\Projects\CDT\Newton>lein deps
Copying 1 file to C:\Projects\CDT\Newton\lib
Downloading: lein-marginalia/lein-marginalia/0.7.0/lein-marginalia-0.7.0.pom fro
m repository central at http://repo1.maven.org/maven2
Unable to locate resource in repository
[INFO] Unable to find resource 'lein-marginalia:lein-marginalia:pom:0.7.0' in re
pository central (http://repo1.maven.org/maven2)
Downloading: lein-marginalia/lein-marginalia/0.7.0/lein-marginalia-0.7.0.pom fro
m repository clojars at http://clojars.org/repo/
Transferring 1K from clojars
Downloading: marginalia/marginalia/0.7.0/marginalia-0.7.0.pom from repository cl
ojars at http://clojars.org/repo/
Transferring 3K from clojars
[INFO] artifact org.clojure:clojure: checking for updates from clojars
[INFO] artifact org.clojure:clojure: checking for updates from stuart
[INFO] artifact org.clojure:clojure: checking for updates from central
Downloading: lein-marginalia/lein-marginalia/0.7.0/lein-marginalia-0.7.0.jar fro
m repository central at http://repo1.maven.org/maven2
Downloading: marginalia/marginalia/0.7.0/marginalia-0.7.0.jar from repository cl
ojars at http://clojars.org/repo/
Unable to locate resource in repository
[INFO] Unable to find resource 'lein-marginalia:lein-marginalia:jar:0.7.0' in re
pository central (http://repo1.maven.org/maven2)
Downloading: lein-marginalia/lein-marginalia/0.7.0/lein-marginalia-0.7.0.jar fro
m repository clojars at http://clojars.org/repo/
Transferring 74K from clojars
Transferring 2K from clojars
Copying 3 files to C:\Projects\CDT\Newton\lib\dev

C:\Projects\CDT\Newton>lein marg
Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodErr
or: clojure.lang.KeywordLookupSite.(ILclojure/lang/Keyword;)V
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.Compiler.eval(Compiler.java:6476)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.load(Compiler.java:6902)
at clojure.lang.RT.loadResourceScript(RT.java:357)
at clojure.lang.RT.loadResourceScript(RT.java:348)
at clojure.lang.RT.load(RT.java:427)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:604)
at clojure.core$use.doInvoke(core.clj:5363)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at leiningen.marg$eval387$loading__4505__auto____388.invoke(marg.clj:1)
at leiningen.marg$eval387.invoke(marg.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.load(Compiler.java:6902)
at clojure.lang.RT.loadResourceScript(RT.java:357)
at clojure.lang.RT.loadResourceScript(RT.java:348)
at clojure.lang.RT.load(RT.java:427)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$require.doInvoke(core.clj:5352)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at leiningen.core$resolve_task.invoke(core.clj:208)
at leiningen.core$apply_task.invoke(core.clj:258)
at leiningen.core$_main.doInvoke(core.clj:329)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:602)
at leiningen.core$_main.invoke(core.clj:332)
at user$eval361.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6431)
at clojure.core$eval.invoke(core.clj:2795)
at clojure.main$eval_opt.invoke(main.clj:296)
at clojure.main$initialize.invoke(main.clj:315)
at clojure.main$script_opt.invoke(main.clj:339)
at clojure.main$main.doInvoke(main.clj:426)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at clojure.lang.Var.invoke(Var.java:413)
at clojure.lang.AFn.applyToHelper(AFn.java:172)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)
Caused by: java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.(IL
clojure/lang/Keyword;)V
at marginalia.parser$get_var_docstring.(parser.clj:85)
at marginalia.parser__init.load(Unknown Source)
at marginalia.parser__init.(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at clojure.lang.RT.loadClassForName(RT.java:2030)
at clojure.lang.RT.load(RT.java:417)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5275)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:604)
at clojure.core$use.doInvoke(core.clj:5363)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at marginalia.core$eval1384$loading__4505__auto____1385.invoke(core.clj:
34)
at marginalia.core$eval1384.invoke(core.clj:34)
at clojure.lang.Compiler.eval(Compiler.java:6465)
... 60 more

C:\Projects\CDT\Newton>

-----Original Message-----
From: Fogus [mailto:reply+i-2632702-
646a2acac5fc7c36f1d79695b9be0a7a5b4d35f5-434849@reply.github.com]
Sent: Tuesday, March 06, 2012 10:34 AM
To: Getchell, Adam
Subject: Re: [marginalia] LaTeX does not appear to work (#76)

Is this still an issue in Marginalia v0.7.0?


Reply to this email directly or view it on GitHub:
fogus#76 (comment)

So, stack trace error is gone, but LaTeX does not work still:

PS C:\Projects\CDT\Newton\docs> ls

Directory: C:\Projects\CDT\Newton\docs

Mode LastWriteTime Length Name


-a--- 3/17/2012 4:57 PM 49695 MathJax.js
-a--- 3/17/2012 5:18 PM 167679 uberdoc.html

PS C:\Projects\CDT\Newton\docs>

project.clj:

(defproject Newton "1.0.0-SNAPSHOT"
:description "Causal Dynamical Triangulations"
:dependencies [[org.clojure/clojure "1.3.0"]]
:main Newton.core
:manifest {"Class-Path" "lib/clojure-1.3.0.jar"}
:dev-dependencies [[lein-marginalia "0.7.0"]]
:marginalia {:javascript ["mathjax/MathJax.js"]})

core.clj:

(ns Newton.core
(:gen-class))

(defn -main [msg](println "Hello" msg))

;; # Loading LaTeX
;;
;; 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}.$$

Results:

http://acgetchell.github.com/uberdoc.html

I notice this is an old issue, and I have the same problem recently. I come out with this solution:
replace

:marginalia {:javascript ["mathjax/MathJax.js"]}

in project.clj with

:marginalia {:javascript ["mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"]}

It works fine for me, hope it help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment