www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

mathjax-convert-unicode.rkt (962B)


      1 #lang at-exp racket/base
      2 (require racket/string
      3          scriblib/render-cond
      4          "katex-convert-unicode.rkt")
      5 
      6 (provide mathjax-convert-unicode)
      7 
      8 (define (mathjax-convert-unicode str* mathmode?)
      9   (define more-sym→*
     10     `([⩴ ,(string-append
     11            "\\ifmathjax{\\mathrel{{\\raise0.9mu{::}\\hspace{-4mu}=}}}"
     12            "\\iflatex{\\Coloneqq}")]
     13       [∈ "\\in{}"]
     14       [⁺ "{}^+"]
     15       [⁻ "{}^-"]
     16       ;; TODO:
     17       [❲ "\\ifmathjax{\\unicode{x2772}}\\iflatex{❲}"]
     18       [❳ "\\ifmathjax{\\unicode{x2773}}\\iflatex{❳}"]
     19       [φ "\\phi"]
     20       [▷ "\\triangleright"]
     21       [∄ "\\nexists"]
     22       [≠ "\\neq"]
     23       [❬ ,(string-append
     24            "\\ifmathjax{\\hspace{-0.2ex}\\unicode{x276C}\\hspace{-0.2ex}}"
     25            "\\iflatex{❬}")]
     26       [❭ ,(string-append
     27            "\\ifmathjax{\\hspace{-0.2ex}\\unicode{x276D}\\hspace{-0.2ex}}"
     28            "\\iflatex{❭}")]))
     29   (katex-convert-unicode str* mathmode? more-sym→*))