Slm2004
Slm2004

Reputation: 225

ioslides with latex package

I want to use a latex command \fint in ioslides. That commond is included in a Latex package "esint". I used the following code in Rmarkdown to include that package. It seems it does not work.

header-includes:
   - \usepackage{esint}
output:
  ioslides_presentation

Is it true that in R presentation, one can not use Latex package? If so, is there anyway to get around to use \fint?

Upvotes: 1

Views: 473

Answers (1)

Martin C. Arnold
Martin C. Arnold

Reputation: 9668

MathJax is not LaTeX: it handles input similar to LaTeX but the way it operates under the hood is completely different: MathJax only implements prominent math mode LaTeX macros using Javascript. Most of the features used by LaTeX packages are missing, which means that you cannot simply 'load' a LaTeX package into ioslides (or any other Rmarkdown project with HTML output) and expect it to work.

I think the closest you can get is with a strikethrough macros, e.g. the one provided with the MathJax extension enclose. This looks halfway decent:

\begin{align}
  \require{enclose}
  \enclose{horizontalstrike}{\int} = \frac{1}{b-a}\int_a^b f(x) \mathrm{d}x
\end{align}

enter image description here

Upvotes: 1

Related Questions