From 725447ec211b761408297b02f43506e85941475c Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sun, 12 Apr 2015 10:04:01 -0700 Subject: [PATCH] simplify MathJax interface --- math.rkt | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/math.rkt b/math.rkt index 3247bde..2092404 100644 --- a/math.rkt +++ b/math.rkt @@ -1,7 +1,7 @@ #lang racket/base (require pollen/convert) -(provide $ $$) +(provide $ $$ mathjax-config mathjax-library) (define mathjax-config #< @@ -17,18 +17,11 @@ HTML HTML ) -(define first-run #t) - (define (mathjax-wrapper #:delimiter delimiter xs) - `(mathjax - ,@(if first-run ; only need mathjax-config & mathjax-library once on the page - (begin (set! first-run #f) (map html->xexpr (list mathjax-config mathjax-library))) - null) - ,(apply string-append `(,delimiter ,@xs ,delimiter)))) + `(mathjax ,(apply string-append `(,delimiter ,@xs ,delimiter)))) (define ($ . x) (mathjax-wrapper #:delimiter "$" x)) - (define ($$ . x) (mathjax-wrapper #:delimiter "$$" x))