Last active
          August 29, 2015 14:15 
        
      - 
      
- 
        Save jeroen/c09fdb0465f7e9382163 to your computer and use it in GitHub Desktop. 
    KaTeX proof of concept
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | library(V8) | |
| ct <- new_context() | |
| ct$source("http://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.js") | |
| html <- ct$call("katex.renderToString", "f(x, \\mu, \\sigma) = \\frac{1}{\\sigma \\sqrt{2\\pi} } e^{ -\\frac{(x-\\mu)^2}{2\\sigma^2}}"); | |
| tmp <- tempfile(fileext = ".html") | |
| writeLines(c('<html><head><meta charset="UTF-8"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.css"></head><body>', html, '</body></html>'), tmp) | |
| browseURL(tmp) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment