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 // restart processing within an element that has been marked as
// ignored above. // ignored above.
// //
processClass: "texMath" //"tex2jax_process", processClass: "texMath", //"tex2jax_process",
// //
// Set to "true" to allow \$ to produce a dollar without starting in-line // Set to "true" to allow \$ to produce a dollar without starting in-line

View File

@ -216,15 +216,17 @@ EOTEX
(void)) (void))
(define ($ s . strs) (define ($ s . strs)
(let ([$- ($-html-handler)])
(cond-element (cond-element
[html (($-html-handler) `(,s . ,strs))] [html ($- `(,s . ,strs))]
[latex `("$" ,s ,@strs "$")] [latex `("$" ,s ,@strs "$")]
;; TODO: use a unicode representation of math, e.g. x^2 becomes x² ;; TODO: use a unicode representation of math, e.g. x^2 becomes x²
[else `(,s . ,strs)])) [else `(,s . ,strs)])))
(define ($$ s . strs) (define ($$ s . strs)
(let ([$$- ($$-html-handler)])
(cond-element (cond-element
[html (($$-html-handler) `(,s . ,strs))] [html ($$- `(,s . ,strs))]
[latex `("\\[" ,s ,@strs "\\]")] [latex `("\\[" ,s ,@strs "\\]")]
;; TODO: use a spatial representation of display math, e.g. ;; TODO: use a spatial representation of display math, e.g.
;; \sum_{i=0}^n x_i^2 ;; \sum_{i=0}^n x_i^2
@ -240,4 +242,4 @@ EOTEX
;; n ;; n
;; ∑ xᵢ² ;; ∑ xᵢ²
;; i=0 ;; i=0
[else `(,s . ,strs)])) [else `(,s . ,strs)])))

View File

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

View File

@ -26,8 +26,8 @@
@title[#:style (with-html5 manual-doc-style)]{@racketmodname[scribble-math]} @title[#:style (with-html5 manual-doc-style)]{@racketmodname[scribble-math]}
@author[ @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] @defmodule[scribble-math]