R Shiny: Latex equations are not properly rendered

我与影子孤独终老i 提交于 2020-01-06 02:27:07

问题


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.


回答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\



回答2:


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"



来源:https://stackoverflow.com/questions/33501836/r-shiny-latex-equations-are-not-properly-rendered

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!