Fixed MathJax support, I'm definitely sure I had tested it at some point, but it seems that it was broken due to several factors!

This commit is contained in:
Georges Dupéron 2017-02-24 01:58:40 +01:00
parent e2ac677fa5
commit c3f96e43a7
4 changed files with 33 additions and 27 deletions

View File

@ -341,7 +341,7 @@ MathJax.Hub.Config({
// restart processing within an element that has been marked as
// ignored above.
//
processClass: "texMath" //"tex2jax_process",
processClass: "texMath", //"tex2jax_process",
//
// Set to "true" to allow \$ to produce a dollar without starting in-line

View File

@ -216,28 +216,30 @@ EOTEX
(void))
(define ($ s . strs)
(cond-element
[html (($-html-handler) `(,s . ,strs))]
[latex `("$" ,s ,@strs "$")]
;; TODO: use a unicode representation of math, e.g. x^2 becomes x²
[else `(,s . ,strs)]))
(let ([$- ($-html-handler)])
(cond-element
[html ($- `(,s . ,strs))]
[latex `("$" ,s ,@strs "$")]
;; TODO: use a unicode representation of math, e.g. x^2 becomes x²
[else `(,s . ,strs)])))
(define ($$ s . strs)
(cond-element
[html (($$-html-handler) `(,s . ,strs))]
[latex `("\\[" ,s ,@strs "\\]")]
;; TODO: use a spatial representation of display math, e.g.
;; \sum_{i=0}^n x_i^2
;; becomes:
;; n
;; ───
;; ╲ 2
;; 〉 x
;; i
;; ───
;; i=0
;; Or use a spatial unicode representation, so that the above becomes:
;; n
;; ∑ xᵢ²
;; i=0
[else `(,s . ,strs)]))
(let ([$$- ($$-html-handler)])
(cond-element
[html ($$- `(,s . ,strs))]
[latex `("\\[" ,s ,@strs "\\]")]
;; TODO: use a spatial representation of display math, e.g.
;; \sum_{i=0}^n x_i^2
;; becomes:
;; n
;; ───
;; ╲ 2
;; 〉 x
;; i
;; ───
;; i=0
;; Or use a spatial unicode representation, so that the above becomes:
;; n
;; ∑ xᵢ²
;; i=0
[else `(,s . ,strs)])))

View File

@ -91,5 +91,9 @@
[ "\\forall"]
[ "\\exists"]
[ "\\equiv"]
[ "\not\\equiv"]))
[ "\not\\equiv"]
[ "\\ldots"]
[ "\\cdots"]
[ "\\uddots"] ;; or \iddots from package mathdots, see http://tex.stackexchange.com/a/17650
[ "\\ddots"]))
str))

View File

@ -26,8 +26,8 @@
@title[#:style (with-html5 manual-doc-style)]{@racketmodname[scribble-math]}
@author[
@author+email["Georges Dupéron" "georges.duperon@gmail.com"]
@author+email["Jens Axel Søgaard" "jensaxel@soegaard.net"]]
@author+email["Jens Axel Søgaard" "jensaxel@soegaard.net"]
@author+email["Georges Dupéron" "georges.duperon@gmail.com"]]
@defmodule[scribble-math]