tcs
March 19, 2023, 9:36pm
1
To make sure that this is not something wrong with my code, I have used the code shown in Links in epub and epubcheck · Issue #766 · rstudio/bookdown · GitHub

```
library(git2r)
library(bookdown)
local_path = "bookdown-demo"
git2r::clone("https://github.com/rstudio/bookdown-demo.git",
local_path = local_path)
epub_file = bookdown::render_book(
"index.Rmd",
bookdown::epub_book())
```

It generates the same Warning that I have in my own code:

```
[WARNING] Could not convert TeX math
SE = \sqrt(\frac{p(1-p)}{n}) \approx \sqrt{\frac{1/3 (1 - 1/3)} {300}} = 0.027
, rendering as TeX
[WARNING] Could not convert TeX math p = \frac{a}{b}, rendering as TeX
[WARNING] Could not convert TeX math
SE = \sqrt(\frac{p(1-p)}{n}) \approx \sqrt{\frac{1/3 (1 - 1/3)} {300}} = 0.027
, rendering as TeX
```

Any suggestions on how to fix it?
Thanks
TS

cderv
March 27, 2023, 6:14pm
2
Either something has changed, or the example never worked with epub strangely....

Math support needs to be activated explicitly.

```
bookdown::epub_book:
pandoc_args: "--mathml"
```

This makes the example working. Also, things to know: EPUB and Math are tricky (Pandoc - Creating an ebook with pandoc ) and several math argument (Pandoc - Pandoc User’s Guide )

I'll update in the website of bookdown demo (and look about what has changed too... )

Thanks for the report

cderv
March 28, 2023, 7:59am
3
I have opened an issue to fix this - we missed a change in Pandoc 2.19 were it requires now to set `--mathml`

explicitly

opened 07:58AM - 28 Mar 23 UTC

closed 01:43PM - 04 May 23 UTC

bug

This was reported in https://community.rstudio.com/t/equations-do-not-render-in-… epub-version/162380/2
We missed a changed in Pandoc 2.19
> EPUB writer:
>
> Allow choice of math method for v3 ([#8164](https://github.com/jgm/pandoc/issues/8164)). Previously we always used MathML for math in EPUB3, because the spec includes MathML. But this is not widely supported by readers, so it seems better to allow users to choose their math method as they can with EPUB2 or HTML. NOTE: Existing workflows that produce EPUBv3 documents including math will be affected by this change. You must add --mathml to your command line if you want to continue producing MathML.
Math needs to be added explicitly now.
- [ ] Also update bookdown-demo

tcs
March 28, 2023, 1:43pm
4
Thanks, adding the ... pandoc_args: "--mathml" solved the problem.

1 Like

system
Closed
April 4, 2023, 1:44pm
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.