ramnathv / slidify

Generate reproducible html5 slides from R markdown
http://www.slidify.org
844 stars 338 forks source link

problem with MathJax exponent #381

Open stla opened 10 years ago

stla commented 10 years ago

Hello,

This file:


---
title       : 
subtitle    : 
author      : 
job         : 
framework   : io2012        # {io2012, html5slides, shower, dzslides, ...}
highlighter : highlight.js  # {highlight.js, prettify, highlight}
hitheme     : tomorrow      # 
widgets     : [mathjax]            # {mathjax, quiz, bootstrap}
mode        : selfcontained # {standalone, draft}

---

## Read-And-Delete

1. $2+2$ ok
2. $a^2$ not ok 

generates this rendering:

capture du 2014-06-21 22 08 16

I have tried to remove the superscript option of markdownToHTML by including this code in the first chunk:

options(rstudio.markdownToHTML = 
  function(inputFile, outputFile) {      
    require(markdown)
    extensions <- markdownExtensions()
    extensions <- extensions[extensions != "superscript"]
    markdownToHTML(inputFile, outputFile, extensions=extensions) 
  }
)

but this has not solved anything.

stla commented 10 years ago

Cool, it works by including this code in the first chunk:

extensions <- markdown::markdownExtensions()
options(markdown.extensions=extensions[extensions != "superscript"])
stla commented 10 years ago

Same problems as https://github.com/ramnathv/slidify/issues/97. About subscripts, this works:

$x_i$ and $x_j$

but this doesn't work:

$x_i$ and $x_{j}$

The latter generates this html tag:

<p>$x<em>i$ and $x</em>{j}$</p>
ramnathv commented 10 years ago

Let me take a look. RStudio has switched from markdown to rmarkdown and I am planning to go down that route too, since rmarkdown offers more robust markdown parsing. But, in the meantime I am sure there is a fix to this within markdown.

stla commented 10 years ago

Indeed, the problem has occured when I installed the latest RStudio.

zhugejun commented 10 years ago

I got the same problem for the latest RStudio.

bamcdougall commented 9 years ago

Is there a current solution for this issue?

stla commented 9 years ago

I don't think so. I do not remember how I solved it for my case but it was not a clean solution.