1

I can't get ioslides to render latex equation. A simple example is:

---
title: "Title"
author: "Author"
date: "Tuesday, November 03, 2015"
output: ioslides_presentation
runtime: shiny
---

## slide 1

$\sum_{i=1}^n X_i$

The equation is rendered as \(\sum_{i=1}^n X_i\

Note that I'm able to get the proper rendering if I create the file as RPresentation but not as ioslides.

madcap
  • 61
  • 1
  • 5

2 Answers2

1

ioslides needs to know that it has to use mathjax

---
title: "Title"
author: "Author"
date: "Tuesday, November 03, 2015"
output: 
  ioslides_presentation:
    mathjax: "http://example.com/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
runtime: shiny
---

## slide 1

$\sum_{i=1}^n X_i$

The equation is rendered as \(\sum_{i=1}^n X_i\
Thierry
  • 18,049
  • 5
  • 48
  • 66
  • This example works on my machine. Did you copy paste the example? What was the output or error message **exactly**. "It didn't help" doesn't give us much to work on... – Thierry Nov 03 '15 at 22:59
  • I copied your example and saved the file as .Rmd. Then I started the presentation by clicking on "Run Presentation". There were no error messages, but the latex expression wasn't rendered as a formula. Instead it displayed as "\(\sum_{i=1}^n X_i\". I also tried opening the page in a browser and got the same result. Hope this detailed description helps. Thanks. – madcap Nov 04 '15 at 00:00
  • Can you post a link to the resulting HTML file? – Thierry Nov 04 '15 at 07:11
  • @madcap I think I have the same problem (http://stackoverflow.com/questions/34024137/part-of-square-root-latex-equation-dissappears-in-pdf-rendering-from-rstudios-r) with rendering square root in my pdf_document. Your solution doesn't help. Any ideas? – rdatasculptor Dec 07 '15 at 15:32
0

So it turned out I needed to change the reference to MathJax in the deck header to:

output: ioslides_presentation: mathjax: "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"

Note that I previously had the following reference to MathJax (which did not work): output: ioslides_presentation: mathjax: "http://example.com/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"

madcap
  • 61
  • 1
  • 5