madcap
madcap

Reputation: 61

R Shiny: Latex equations are not properly rendered

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.

Upvotes: 1

Views: 1114

Answers (2)

madcap
madcap

Reputation: 61

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"

Upvotes: 0

Thierry
Thierry

Reputation: 18487

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\

Upvotes: 1

Related Questions